Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Calling Server Side ActiveX DLL

by THuG (Beadle)
on Jul 18, 2001 at 21:19 UTC ( [id://97776]=perlquestion: print w/replies, xml ) Need Help??

THuG has asked for the wisdom of the Perl Monks concerning the following question:

Okay, I've been doing work with ASPs in VBScript. I was asked to put together a Proof of Concept based on some other work. That's fine, but I am getting increasingly upset with VBScript, and I didn't feel like doing this quick and dirty PoC in multidimensional arrays that would need to be ReDim'ed every time I wanted to add an element.

I downloaded ActivePerl and have done this most recent ASP in PerlScript. But I need to add a chart to this page. The VBScript ASPs have been calling a server side ActiveX DLL that accepts an array (variant), builds a chart from the MSChart control and returns a filename. That filename is the JPeg image of the chart, you just include it in the img tag.

Well, I went in and doctored the ActiveX DLL so it is accepting a comma delimited string of values instead of an array. But I'm getting an unspecified syntax error when I call it.

Does anyone have any ideas, or have any ideas as to how I can find out more about why it is not working.

Here is the an example of the original VBScript

<%@ Language='VBScript' %> <% Dim PieChart, FileName Set PieChart = Server.CreateObject("WCP.WCPCharts") FileName = PieChart.CreatePieChart(arrChartData) %>

This is my test ASP to see if I can make the call with PerlScript.

<%@ Language='PerlScript' %> <% my $return; my $labels = "first,second,third"; my $averages = "3,4,5"; my $maxes = "6,7,8"; my $mins = "1,2,3"; my $ChartObject = $Server->CreateObject("WCP.WCPCharts") $ChartObject->CreateBarChart($return, $labels, $averages); %> <%=$return%>

I'm getting a syntax error on line 11. $maxes and $mins are optional arguements to CreateBarChart. I get the same error if I include them.

-Travis

Replies are listed 'Best First'.
Re: Calling Server Side ActiveX DLL
by THuG (Beadle) on Jul 18, 2001 at 21:35 UTC

    Just to make sure... I threw together this...

    <%@ Language='VBScript' %> <% Dim strReturn Dim strLabels strLabels = "first,second,third" Dim strAverages strAverages = "3,4,5" Dim strMaxes strMaxes = "6,7,8" Dim strMins strMins = "1,2,3" Dim objChart Set objChart = Server.CreateObject("WCP.WCPCharts") objChart.CreateBarChart strReturn, strLabels, strAverages %> <%=strReturn%>

    It works. The DLL returns a subscript error, but that is okay, the ASP is getting that message in the strReturn and displaying it on the page like it is supposed to. I can fix the subscript problem.

    -Travis

Re: Calling Server Side ActiveX DLL
by mikeB (Friar) on Jul 18, 2001 at 22:15 UTC
    Perl sometimes is confused about which line caused the error. Look closely at line 10.

      Thanks. MDillon pointed that out, too. *grumblestupidtravisgrumble*

      Dillon also pointed out that $return should be a reference. A reference here how?

Re: Calling Server Side ActiveX DLL
by THuG (Beadle) on Jul 18, 2001 at 22:47 UTC

    Okay, so I have fixed the missing ; from line 10. Here is the ASP

    <%@ Language='PerlScript' %> <% my $return; my $labels = "first,second,third"; my $averages = "3,4,5"; my $maxes = "6,7,8"; my $mins = "1,2,3"; my $ChartObject = $Server->CreateObject("WCP.WCPCharts"); $ChartObject->CreateBarChart($return, $labels, $averages); %> <%=$return?"It is set":"It is not set"%><br> <%=$return%>

    It is printing "It is not set". I don't know why. The VBScript version is returning a message from the DLL like it should.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://97776]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-18 07:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found