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


S

Sacha Korell

(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
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top