well here is a copy paste example of what you need
<ComClass(ComCl sMP.ClassId, ComClsMP.Interf aceId, ComClsMP.Events Id)> _
Public Class ComClsMP
#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
' make sure that the below values are unique for every new project
Public Const ClassId As String = "7BAC16DC-0103-4BA3-9A89-53253372D711"
Public Const InterfaceId As String = "3CE4FCAF-CEEA-4849-9743-0E8E38D313AE"
Public Const EventsId As String = "7E90CE2E-8A8C-45A2-870A-3461A9DF28B7"
#End Region
Public Sub Helloworld()
MsgBox("This is a helloworld EXAMPLE from a VB.NET DLL exposed to COM")
End Sub
' A creatable COM class must have a Public Sub New()
' with no parameters, otherwise, the class will not be
' registered in the COM registry and cannot be created
' via CreateObject.
Public Sub New()
MyBase.New()
End Sub
End Class
If you want to use this assembly on a pc on wich it wasn`t compiled then
register it with RegAsm.exe or use a installer ( the standard installer
in VS.Net is fine for this task )
late binded VB6 example how to call the dll ( no reference or anything is
necessary in this case )
Dim Objenc As Object
Set Objenc = CreateObject("a ssemblyname.cla ssname")
Objenc.Hellowor ld
Well i hope to have given you some ideas :-)
Happy coding
M. Posseth [MCP Developer]
"Dominic via DotNetMonster.c om" <fo***@nospam.D otNetMonster.co m> wrote in
message news:ee******** *************** *******@DotNetM onster.com...
I am a CA-OpenROAD programmer, but I attempting to build some VB.NET DLLs
and access them through OpenROAD as an external Windows TypeLib.
I have managed to build a simple DLL (code follows) but the only method
that I can see exposed is "DisplayNum ber" which is a sub declared in a
public interface definition rather than "DisplayNumbers " which is the name
of the public sub based on the interface definition.
My problem is when I attempt to call the "displaynum ber" method I get an
error saying that this method does not exist for the class "myinterfac e".
What I would like to know is this a common problem for calling methods in
a VB.NET DLL external to .NET apps? Ultimately I want to call the
"displaynumbers " method.
FYI after I built the DLL I the performed the following commands in the
bin dir of the project (ClassLibrary4) :
regasm.exe /tlb:ClassLibrar y4.tlb ClassLibrary4.d ll
gacutil.exe /i ClassLibrary4.d ll
And here is the code:
--------------------------------------------------------------
Public Interface MyInterface
Sub DisplayNumber()
End Interface
Public Class Class1
Implements MyInterface
Public Sub DisplayNumbers( ) Implements MyInterface.Dis playNumber
' This method does nothing. I am hoping to just see it.
MsgBox("This is from a VB.NET DLL")
End Sub
End Class
-----------------------------------------------------------------------
Any help would be much appreciated.
Dominic