dll registration issue

  • Thread starter Thread starter Mike Whitaker
  • Start date Start date
M

Mike Whitaker

So far I have tested building a .dll file with an interface. Then by
generating another VB.Net project that has a reference to the .dll I can
happily see the interface of the .dll. All of this is in VB.Net. This seems
pretty neat, and will allow for variables to be passed from one app to the
other happily. At the moment all the .dll does is open a form.

However, if I create a project in VB 6, it throws an error when I try and
set a reference to my .Net .dll file ("Can't add a reference to the given
file")
If I try and register the .dll through VBA in Access (Shell "regsvr32.exe
C:\Data\TEST\Test_OCX\bin\Test_OCX.dll"), I get an error to the effect of an
invalid entry point in the .dll.

All that the .dll file contains is a class with a public sub that opens the
form. (vb.net 2003)

Any thoughts?

Am I trying to register the .dll in VB 6 the wrong way or is there something
that I am missing with building the .dll?

If I build pretty much a similar .dll or .ocx in VB 6 then it appears as
though both VB 6 and .Net can interact with the control.

Any thoughts?

Thanks in advance,

Mike
OnSite Applications
 
* "Mike Whitaker said:
So far I have tested building a .dll file with an interface. Then by
generating another VB.Net project that has a reference to the .dll I can
happily see the interface of the .dll. All of this is in VB.Net. This seems
pretty neat, and will allow for variables to be passed from one app to the
other happily. At the moment all the .dll does is open a form.

However, if I create a project in VB 6, it throws an error when I try and
set a reference to my .Net .dll file ("Can't add a reference to the given
file")
If I try and register the .dll through VBA in Access (Shell "regsvr32.exe
C:\Data\TEST\Test_OCX\bin\Test_OCX.dll"), I get an error to the effect of an
invalid entry point in the .dll.

All that the .dll file contains is a class with a public sub that opens the
form. (vb.net 2003)

Any thoughts?

Am I trying to register the .dll in VB 6 the wrong way or is there something
that I am missing with building the .dll?

If I build pretty much a similar .dll or .ocx in VB 6 then it appears as
though both VB 6 and .Net can interact with the control.

..NET DLLs cannot be used directly with VB6. You will have to regiuster
them for COM interop and "export" classes and methods to COM:

<http://mvps.org/dotnet/dotnet/samples/codingtechnique/downloads/MyComLib.zip>
 
Thanks for the pointers.

VB 6 now happily runs the .dll as a .tlb, though MS Access makes a
reference, then crashes when it tries to load a form. Any thoughts?

Thanks agan.

Mike
 
Back
Top