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

This question is related to an earlier one that I posted. But the issue has been boiled down to its simpliest parts. I am sorry for posting to SoPW twice today about this, but I could use some help understanding this.

I've been working with rchiav and have produced a DLL and two ASPs with the following code.

VB ActiveX DLL

Public Function CopyString(ByRef strTo, ByVal strFrom) strTo = strFrom End Function

VB ASP

<%@ Language='VBScript' %> <% Dim strTo Dim strFrom strFrom = "This is my test string" Dim objDLLTest Set objDLLTest = Server.CreateObject("myTest.myClass") objDLLTest.CopyString strTo, strFrom %> <%=strTo%>

PerlScript ASP

<%@ Language='PerlScript' %> <% my $to; my $from = "This is my test string"; my $DLLObject = $Server->CreateObject("myTest.myClass"); $DLLObject->CreateBarChart($to, $from); %> <%=$to?"It is set":"It is not set"%><br> <%=$to%>

The VB ASP result reads "This is my test string". The PerlScript ASP reads "It is not set".

How do I pass and return strings from a VB DLL?

Replies are listed 'Best First'.
Re: Passing Strings to VB
by THuG (Beadle) on Jul 19, 2001 at 00:30 UTC

    Nevermind.... Albannach pointed out that I didn't change the function name in the PerlScript ASP.

    Would be nice if we could close and delete our threads. Maybe we can and I just don't know how, but ignore all of this. Sorry to waste everyone's time.

      Of note: I can't get $DLLObject->CopyString($to, $from); to work, but I can get $to = $DLLObject->CopyString($from); to work.

      Ofcourse, I recompiled the DLL each time, so I'm not trying to make those two calls into the same DLL.