How do I declare a string and pass it from a Visual Basic GUI to a C++ DLL?

Discussion in 'General Software Discussion' started by complete, Jan 14, 2006.

  1. complete

    complete New Member

    Joined:
    Aug 29, 2005
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    How do I declare a string and pass it from a Visual Basic GUI to a C++ DLL?

    Now I am debugging successfully. I can debug either on the Visual Basic end
    or I can debug on the C++ side by using the DLL's project file and declaring
    the compiled VB code as the launching executable. I have narrowed the problem
    down to the way that I am declaring and passiing the string variables.
     
  2. pr0digal jenius

    pr0digal jenius Delete Me

    Joined:
    Mar 15, 2004
    Messages:
    14,526
    Likes Received:
    28
    Trophy Points:
    0
    oooh.

    I really have no idea...it SOUNDS like something you'll have to use a wrapper on to pass, although you mihgt can get away with doing some sort of conversion upon reading it instead.

    And while this is a horrible answer, you may have some luck trying visual C# as well, as it has all the gui aspects of VB, and has similar power to C++
     
  3. logos1

    logos1 New Member

    Joined:
    Feb 8, 2005
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    this is one of the main issues that microsoft has attempted to solve with their .net framework.

    the other way is to use symbol resolution and binding to a type that's recognizable by both ends. declare a char array and export it as a public symbol in your dll, and use whatever vb's equivalent to __declspec(dllimport) is to import it into your application.
     
  4. dehx

    dehx New Member

    Joined:
    Mar 17, 2006
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    It would help if you told us what version of C++ and VB you are using.
     

Share This Page

visited