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

  • Thread starter Thread starter Valli
  • Start date Start date
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
 
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
 
Back
Top