|
-
Nov 1st, 2000, 04:54 PM
#1
Thread Starter
Lively Member
I create a dll using VB6 where a number
of variables are passed with 3 string values being
passed ByRef to a public function.
(ie.
public function MyFunction(byVal var1 as lng,
byval var2 as bln, byRef var3 as string,
byRef var4 as string, byRef var5 as string)
as boolean
)
A recordset is opened and the values, along with
HTML tags, are added to these 3 strings.
On my asp page I get the values from the previous form.
Pass these values to the function and then print the 3
string variables.
I tested the dll with another VB6 application to make sure
the strings were formatted correctly.
I put the dll in the same directory as my asp page, included
the file in the asp code.
(ie.
<% OPTION EXPLICIT %>
<!-- #include file="CreateCallRpt.dll" -->
)
But, when I run the page I receive an entire page like:
MZÿÿ¸@Àº´ Í!¸LÍ!This program cannot be run in DOS mode. $QÎÛU0 ˆU0 ˆU0 ˆÖ,®ˆT0 ˆf`f¨DfnMfû^fU§ f(Ef©
...
What am I doing wrong?
-
Nov 2nd, 2000, 10:16 AM
#2
Frenzied Member
Your including a binary file as HTML/ASP.
You need to register the dll on the PC that is running your IIS server, then call it like this:
Dim objMyDll
Set objMyDll = Server.CreateObject("DllName.ClassName")
Then you can use it's methods and properties.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Nov 2nd, 2000, 12:36 PM
#3
Thread Starter
Lively Member
Thanks,
I will try registering the DLL properly.
As for the object:
My DLL doesn't not contain any object only one public
function (and numerous private ones).
So I don't actually create an object, I only call the public
function found within.
ie.
<!-- #include file="CreateCallRpt.dll" -->
<%
dim blnStatus, lngVar1, blnVar2, strVar3
dim strVar4, strVar5
lngVar1 = 1
blnVar2 = FALSE
blnStatus = MyFunction(lngVar1, blnVar2, strVar3,
strVar4, strVar5)
response.write strVar3
response.write strVar4
response.write strVar5
%>
-
Nov 2nd, 2000, 02:40 PM
#4
Frenzied Member
You can't create an ActiveX dll without a class. VB adds it for you when you choose an ActiveX dll project type.
You maybe just didn't realize it, but your one function *IS* inside of a class. One which you will need to verify the name (although I would suspect 'Class1' since that is the default)
And you DO create an object because your dll is an object that just happens to have only one public method. You can't just include it and use it's methods without creating an instance of the object first.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|