|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Error in creating a server object from custom activex dll
I have written an ActiveX dll to perform some work. At the top of my ASP script I place the following line.
<!--METADATA TYPE="TypeLib" NAME="MyClass" FILE="c:\windows\system32\MyClass.dll"--> I try to create an object using the following line. Set MyObj = Server.CreateObject("MyClass") I get the error "Invalid class string " on that line. What am I doing wrong? |
|
#2
|
||||
|
||||
|
I have never seen a dll included in ASP code in this way... I would say that one of the following problems exists, though - #1... the DLL is not registered on the server where you are trying to run it, or #2... check your instantiation of the class you are trying to use. The way it looks, you have a dll called myclass, and you are trying to set an object variable = to that dll... the only problem with this is that a dll is a type, not a class. it look like you need to create your variable by
Code:
set myObj = Server.CreateObject("MyClass.SomeClass")
Much like creating a adodb connection or recordset, where you might have Code:
set myConn = Server.CreateObject("ADODB.Connection")
What is the METADATA tag for? Could you show me where you saw this form of dll inclusion?
__________________
Fisherman "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein |
|
#3
|
|||
|
|||
|
Figured it out
The correct syntax is: server.createobject("MyProject.MyClass")
The meta tag is a reference to the dll that holds the class. Is that what you are asking? |
|
#4
|
||||
|
||||
|
Ok, I guess I can handle that, I've just never seen it done that way - I've always just registered the dll using RegSver32 on the Server, and then simply instantiated a new variable of that dll's class.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Error in creating a server object from custom activex dll |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|