Windows Vista Forums

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


    Valli Guest

    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

  2. #2


    Family Tree Mike Guest

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



    "Valli" wrote:

    > 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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
F.E.A.R. 2 Project Origins. fadedrs Gaming 9 20 Jun 2009
Want to run my project in all browsers Chetana .NET General 2 22 May 2008
In any project, Can't we refer classes directly, (without addingphysically in the project)? Rachana .NET General 1 28 Mar 2008
Microsoft Advances Its Project Management Technology and the Project Management Profession z3r010 Vista News 0 20 Oct 2006
UserControl in VB project Eli Avalon 1 05 Jun 2006