Yes, correct. Server.CreateObject is used to create a server instance of a COM object. CreateObject uses late binding (that is, the type of the object isn't known until runtime.
You should use the Dim bla1 As New Bla() construct for classes defined in .NET assemblies (even if they are just a wrapper around a "classic" COM object) and use Server.CreateObject to instantiate COM objects directly.
Theoretically, both methods below should work:
Code:
' 1. Late Binding, using CreateObject against a COM ProgID
Dim MyTestApp As Object
MyTestApp = Server.CreateObject("Test.Application")
' 2. Strongly typed, against a .NET assembly
Dim Obj As Test.Application
Obj = New Test.Application()
I am still a bit surprised that the first method doesn't work for you. This code:
Code:
Dim objConn As Object
objConn = Server.CreateObject("ADODB.Connection")
returns a perfectly valid ADODB Connection object, so the same should apply to your COM object as well.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.