Need to access VC++ dll in VB.net project

V

Valli

Hi,

I have written a small VC++ program to decompress the incoming message & return the new message length.
Compiled that into a dll & referred in a vb.net project.

In .net project, I am able to access the function which I declared in dll. Compilation also done perfectly. But when execution comes to that dll line, error "The source code is available" is thrown.

In the dll project, the function needs to be accessed is declared as
extern "C" __declspec(dllexport)int GetFullMsg(lzo_byte* in, lzo_byte* out, int iCompLen, lzo_uint* new_len );

In .net project , I have declared as
Private Declare Function GetFullMsg Lib "E:\Valli\ActiveTraderDotnet\SOURCE\ATActiveComponents\Bin\BCMDecompression.DLL" (ByVal in1 As Char, ByVal out As Char, ByVal iCompLen As Integer, ByVal new_len As UInteger) As Integer

the line which throws error is - GetFullMsg(indata, outdata, CompLen, new_len)

Can anyone help me to fix this error? Is the declarations are wrong?

Thanks in advance
Valli
 
F

Family Tree Mike

Valli said:
Hi,

I have written a small VC++ program to decompress the incoming message & return the new message length.
Compiled that into a dll & referred in a vb.net project.

In .net project, I am able to access the function which I declared in dll. Compilation also done perfectly. But when execution comes to that dll line, error "The source code is available" is thrown.

In the dll project, the function needs to be accessed is declared as
extern "C" __declspec(dllexport)int GetFullMsg(lzo_byte* in, lzo_byte* out, int iCompLen, lzo_uint* new_len );

In .net project , I have declared as
Private Declare Function GetFullMsg Lib "E:\Valli\ActiveTraderDotnet\SOURCE\ATActiveComponents\Bin\BCMDecompression.DLL" (ByVal in1 As Char, ByVal out As Char, ByVal iCompLen As Integer, ByVal new_len As UInteger) As Integer

the line which throws error is - GetFullMsg(indata, outdata, CompLen, new_len)

Can anyone help me to fix this error? Is the declarations are wrong?

Thanks in advance
Valli

I would be suspect of your original C++ datatypes mapping the way you did
them. What are the definitions of lzo_byte and lzo_uint? One normall would
not redefine the standard byte and uint unless there was something changed.

Mike
 

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