Connecting Tech Pros Worldwide Forums | Help | Site Map

How to access unmanaged DLL from within ASP.NET (using VB.NET)

Sacha Korell
Guest
 
Posts: n/a
#1: Nov 17 '05
(This is a continuation of my post from earlier today.)

I have been semi-successful by using the good old DECLARE FUNCTION like
this:
Declare Function OpenCD Lib "functions.dll" Alias "COpenCD" (ByVal
DiscNumber As Long, ByVal DiscPath As String) As Long

However, when I make the call to the function within the DLL I get:

"Object reference not set to an instance of an object."

Do I somehow have to instantiate the DLL???

====================================

I have also tried to use the DllImport statement like this:

<DllImport("functions.dll", EntryPoint:="OpenCD", SetLastError:=True,
CharSet:=CharSet.Unicode, ExactSpelling:=True,
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function COpenCD(ByVal DiscNumber As Long, ByVal DiscPath As
String) As Long

' Leave function empty - DLLImport attribute forwards calls to OpenCD to

' OpenCD in functions.dll.

End Function


....but when I use it, I get:

"Unable to find an entry point named OpenCD in DLL functions.dll."

How can I access an unmanaged DLL from within ASP.NET?
Please help!

Thanks,

Sacha



Closed Thread