By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,682 Members | 1,368 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,682 IT Pros & Developers. It's quick & easy.

dll registration issue

P: n/a
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

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
* "Mike Whitaker" <mw@onsiteapplications_notreal.com.au> scripsit:
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>

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

P: n/a
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
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bm************@ID-208219.news.uni-berlin.de...
* "Mike Whitaker" <mw@onsiteapplications_notreal.com.au> scripsit:
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/sample...ds/MyComLib.zi
p>
--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.