Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

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

Reply
 
Old 04-27-2009   #1 (permalink)
Valli


 
 

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

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


My System SpecsSystem Spec
Old 04-28-2009   #2 (permalink)
Family Tree Mike


 
 

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



"Valli" wrote:
Quote:

> 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
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Hp m9040n project General Discussion
Cannot create new project .NET General
In any project, Can't we refer classes directly, (without addingphysically in the project)? .NET General
Microsoft Advances Its Project Management Technology and the Project Management Profession Vista News


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46