Home All Groups Group Topic Archive Search About
Author
13 Jul 2006 1:42 PM
vul
I created very simple Class Library in VB 2005 (let's call it COMInterop). I
set  Register For COM Interop property to true to make it accessible by VB6
program.
After I compiled it, I got COMInterop.dll and COMInterop.tlb files, I have
no problem with using both of them on the machine where the project was
compiled - TLB with VB6 clients and DLL with VB 2005 clients.
I copied the tlb and dll files onto another machine and registered TLB file
with regtlib.exe. I've got a message about successful registration.
I created a new VB 2005 Windows Form project, added the reference to
COMInterop.dll and it works fine.
I created VB6 project, added a reference to this TLB. I'm trying to use it
with the simple code which works with VB 2005, but produces an error in VB6:
Run time error '429':
ActiveX component can't create object

The code in client:
Private obj As COMInteropTest.COMInterop
Private Sub Command1_Click()
    Set obj = New COMInteropTest.COMInterop 'The error occurs on this line
    MsgBox obj.myFunction
End Sub

What am I missing? How do I make VB6 client work with TLB on any machine,
not only on the machine it was created?

Thank you
Al

Author
13 Jul 2006 7:53 PM
Mattias Sjögren
>What am I missing? How do I make VB6 client work with TLB on any machine,
>not only on the machine it was created?

Teh assembly must be located somewhere the runtime will look for it
(the GAC, the application directory) or you must register it with the
/codebase flag.


Mattias

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Author
6 Sep 2006 5:47 PM
Phil Hunt
try
Regasm "your dll" \codebase


Show quote
"vul" <a**@optonline.net> wrote in message
news:%23aO1%23IopGHA.4236@TK2MSFTNGP03.phx.gbl...
>I created very simple Class Library in VB 2005 (let's call it COMInterop).
>I
> set  Register For COM Interop property to true to make it accessible by
> VB6
> program.
> After I compiled it, I got COMInterop.dll and COMInterop.tlb files, I have
> no problem with using both of them on the machine where the project was
> compiled - TLB with VB6 clients and DLL with VB 2005 clients.
> I copied the tlb and dll files onto another machine and registered TLB
> file
> with regtlib.exe. I've got a message about successful registration.
> I created a new VB 2005 Windows Form project, added the reference to
> COMInterop.dll and it works fine.
> I created VB6 project, added a reference to this TLB. I'm trying to use it
> with the simple code which works with VB 2005, but produces an error in
> VB6:
> Run time error '429':
> ActiveX component can't create object
>
> The code in client:
> Private obj As COMInteropTest.COMInterop
> Private Sub Command1_Click()
>    Set obj = New COMInteropTest.COMInterop 'The error occurs on this line
>    MsgBox obj.myFunction
> End Sub
>
> What am I missing? How do I make VB6 client work with TLB on any machine,
> not only on the machine it was created?
>
> Thank you
> Al
>
>

AddThis Social Bookmark Button