Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot Create Instance of COM DLL

Status
Not open for further replies.

metsey

Programmer
Mar 2, 2001
49
US
I am running w2000 w/IIS 5.0 and InterDev

I developed an ActiveX DLL in VB6 compiled/installed/and registered on my pc. I tested it with a VB6 client test program and it works.

I set a reference to it in my web project - in global.asa it is as such:

<!--METADATA TYPE=&quot;TypeLib&quot; NAME=&quot;eBPADTS&quot; UUID=&quot;{F0834C25-CBD7-4511-9611-A1F1B74FA47F}&quot; VERSION=&quot;2.0&quot;-->

The code on my Test.asp page is:

<%Set oDTS = Server.CreateObject(&quot;eBPADTS.cDTS&quot;)%>

<%Dim b %>

<%b=oDTS.Execute%>

<%If b = False Then
Response.Write &quot;bad&quot;
ElseIf b = True Then
Response.Write &quot;good&quot;
Else
Response.Write &quot;???&quot;
End If%>


The Execute method returns a boolean value.

However, I keep getting an &quot;Unhandled error&quot; message on the CreateObject line.

Please advise as to why my COM object won't work?
 
The &quot;unhandled error&quot; problem may be in sub-components. Did you create other objects in Class_Initialize usining CreateObject or As New instead of Server.CreateObject. If so, then you may need to move that code to a two methods, one for non-ASP and another for non-ASP with the ASP context using Server.CreateObject. You then nee to call the proper &quot;Initialize&quot; method epending on the caller, SP or non-ASP. Remember, VBScript only works with Variant types.

Farther down the road, VBScript expects a Variant type as a return value. It will not &quot;know&quot; Boolean but it will take a Variant that contains a Boolean. Compare Code (Text)
Generate Sort in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top