Using my vb.net library from COM

  • Thread starter Thread starter MattB
  • Start date Start date
M

MattB

I have a vb.net assembly I need to make available as a COM object.
After some Googling, I found this site:
http://www.dnzone.com/ShowDetail.asp?NewsId=126
I followed the steps (substituting my application, class, and function
names) and got no errors during the process.

But now I try to access my library from vbscript, I get a "Can't create
object" error.
So I tried to register it with regsvr32 and get the error:
"DllRegisterServer entry point not found"

So something seems to have not gone right, but I don't know enough about COM
to see where. Here's a little sample code from the vb.net library. If anyone
has any ideas I'd be interested to hear them. Thanks!

Assembly code:

Namespace InetEZ
Public Class Util
Public Shared Function GetInfo()
Return "<descrip>My function library</descrip><version>.5
Alpha</version>"
End Function
End Class
End Namespace

-------------------------------

vbscript:

Dim oX, x
Set oX=createobject("InetEZ.Util")
x=oX.GetInfo("")
MsgBox(x)
Set oX=Nothing
 
Hi,

You need to register the class with regasm.exe to be able to use it
with com.
http://msdn.microsoft.com/library/d...ml/cpgrfAssemblyRegistrationToolRegasmexe.asp

Ken
--------------------
I have a vb.net assembly I need to make available as a COM object.
After some Googling, I found this site:
http://www.dnzone.com/ShowDetail.asp?NewsId=126
I followed the steps (substituting my application, class, and function
names) and got no errors during the process.

But now I try to access my library from vbscript, I get a "Can't create
object" error.
So I tried to register it with regsvr32 and get the error:
"DllRegisterServer entry point not found"

So something seems to have not gone right, but I don't know enough about COM
to see where. Here's a little sample code from the vb.net library. If anyone
has any ideas I'd be interested to hear them. Thanks!

Assembly code:

Namespace InetEZ
Public Class Util
Public Shared Function GetInfo()
Return "<descrip>My function library</descrip><version>.5
Alpha</version>"
End Function
End Class
End Namespace

-------------------------------

vbscript:

Dim oX, x
Set oX=createobject("InetEZ.Util")
x=oX.GetInfo("")
MsgBox(x)
Set oX=Nothing
 
Back
Top