Click here to Skip to main content
15,503,367 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created an application in using com class ,
so that i can use that dll in vb6 application

<ComClass(ComClass1.ClassId, ComClass1.InterfaceId, ComClass1.EventsId)> _
Public Class ComClass1

#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.
    Public Const ClassId As String = "23520cb2-aa3a-431a-b87e-bb23ad6c0c42"
    Public Const InterfaceId As String = "c6d19f7e-8184-4c6c-b799-8f086a8ab04e"
    Public Const EventsId As String = "5bd8aa70-44ba-4f56-a3c8-fc9bca0befdf"
#End Region

    ' 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()
    End Sub

    Public Function subt(ByVal a As Integer, ByVal b As Integer)
        Return a - b
    End Function
End Class

This Dll is used as a reference in vb6 application

if i give the reference dll in vb6 application it is working fine with my system environment but if i try to run that exe in other system then it is throwing me the error as

activex component can't create object

Thanks in advance
Pavan R

You have to deploy that dll also on the other system, and that means that you also have to register (regsrv32) it.
Share this answer
Thanks Bernhard Hiller

But can you let me know how to use the dll in other different system without registering the DLL .

Thanks in advance
Pavan R
Share this answer
Could you help me how to register a .net DLL using regasm through code in vb6

Thanks in advance..
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900