Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 14-Jun-12 23:29pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Could you help me how to register a .net DLL using regasm through code in vb6
 
Thanks in advance..
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You have to deploy that dll also on the other system, and that means that you also have to register (regsrv32) it.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 359
1 _Amy 230
2 Manfred R. Bihy 200
3 CHill60 180
4 OriginalGriff 175
0 OriginalGriff 7,495
1 Sergey Alexandrovich Kryukov 6,402
2 Maciej Los 3,849
3 Peter Leow 3,568
4 CHill60 2,702


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 16 Jun 2012
Copyright © CodeProject, 1999-2014
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