Click to See Complete Forum and Search --> : Creating DLL in VB.net


MoonNight
October 7th, 2002, 08:44 AM
:confused:
Hi!

It's be three days that I try doing this without any success.

I created a simple class that I compiled into a DLL file using vb.net. I then reference it using "Declare Ansi Function functName Lib "libName" (ByVal myVariable As String) As String". Everything compiles nice and easy. However, at run time when I make use of that linked function, I get an error: "An unhandled exception of type 'System.EntryPointNotFoundException' occurred in MyEXE.exe" and "Unable to find an entry point named functName in DLL MyDLL.dll".

I checked the IL code and found no entry point for the function, which is kind of understandable since it is not a main function. I tried adding a ".entrypoint" right into the IL file generated using ILDASM tool, but then it didn't want to compile back into DLL file using the ILASM tool because functName is not a static function. Bt then i can't make functName into a static function either since it is a method called from somewhere else...

Please help!

Moon Night ;)

DSJ
October 7th, 2002, 11:37 AM
You don't need to delare a .NET DLL it, just set a reference to it (Project... Add Reference... Browse...).

MoonNight
October 7th, 2002, 02:15 PM
Thank you so much. I am new to vb so your help is really appreciated!