Re: How to access and use Unmanaged Code
- From: "Michael" <mconnolly4@xxxxxxxxxxxxxx>
- Date: Fri, 28 Jul 2006 12:25:07 GMT
Chris
Thanks for the reply
I have managed to get past the Object reference but now I am encountering an
error when running the application.
The error I am getting is "Unable to load DLL filename"
I have tried to reference the DLL within net but can't as net does not
recognize it as a valid assembly or COM object. I know its OK as I can get
Microsoft Depends to open it and read the import/export ordinal and other
data etc.
I have tried to register it via regasm and AL neither will accept it.
I have tried putting the dll in the system folder, windows folder, along
with the default project path
Nothing seems to work.
To investigate further I created a simple fortran function to add two
integers and reference it using the using the declare statement in VB. The
same exact problem results - unable to load DLL during execution.
I guess the issue is how do you get net to recognize a dll that was
constructed outside of net ie "unmanaged"?????????
Can you help?
Thanks
Mike C.
"Chris Dunaway" <dunawayc@xxxxxxxxx> wrote in message
news:1154007001.060395.168870@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Michael wrote:
I am trying to access external code from within VB using DLLimport in
the
form below where testsub is the procedure name within the DLL
<DllImport("MyDll.dll", EntryPoint:="testsub", SetLastError:=True, _
CharSet:=CharSet.Unicode, ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Sub _
Test(ByVal JOB As Char, ByRef A(,) as Double)
When calling the routine from VB.Net I keep on getting an "Object
reference
not set to instance object" error
Can you post the stack trace when you get that exception? Where does
the error occur? Can you debug the app and step through the code to
find the line where the exception is thrown?
.
- Follow-Ups:
- Re: How to access and use Unmanaged Code
- From: Michael
- Re: How to access and use Unmanaged Code
- References:
- How to access and use Unmanaged Code
- From: Michael
- Re: How to access and use Unmanaged Code
- From: Chris Dunaway
- How to access and use Unmanaged Code
- Prev by Date: Re: how to speed up collections iteration
- Next by Date: Re: ADO.NET dataset limit
- Previous by thread: Re: How to access and use Unmanaged Code
- Next by thread: Re: How to access and use Unmanaged Code
- Index(es):
Relevant Pages
|