Click here to Skip to main content
11,496,146 members (812 online)
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
See more: VB6 ActiveX object
I have created an application in vb.net 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()
        MyBase.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
Posted 15-Jun-12 0:29am
You have to deploy that dll also on the other system, and that means that you also have to register (regsrv32) it.
  Permalink  
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
  Permalink  
Could you help me how to register a .net DLL using regasm through code in vb6

Thanks in advance..
  Permalink  

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

  Print Answers RSS
0 Dnyaneshwar@Pune 692
1 RyanDev 230
2 CHill60 163
3 Sascha Lefèvre 145
4 Sergey Alexandrovich Kryukov 124
0 Sergey Alexandrovich Kryukov 10,401
1 OriginalGriff 8,910
2 Sascha Lefèvre 3,899
3 Maciej Los 3,422
4 Richard Deeming 2,600


Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 16 Jun 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100