Pass String from Visual Basic GUI to a C++ DLL?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Athono
    New Member
    • Jan 2006
    • 3

    Pass String from Visual Basic GUI to a C++ DLL?

    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.
  • Niheel
    Recognized Expert Moderator Top Contributor
    • Jul 2005
    • 2432

    #2
    Here is an article about how you can interface a VB DLL to a C++ DLL so that you can move data/strings between them. It's a good article.


    Here is another article that shows you can call a C++ DLL from visual basic.


    When you get it to work, please let us know . . . paste some sample code for the rest of us.
    niheel @ bytes

    Comment

    • jmg6223
      New Member
      • Oct 2006
      • 1

      #3
      Please ecuse my novice in this area, but regarding the interfacing of a Visual Basic GUI with C++, I see form the previous responses that it is possible, maybe even simple. Can the same be said for a Visual Basic GUI and C, not C++? any advice is appreciated.

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by jmg6223
        Please ecuse my novice in this area, but regarding the interfacing of a Visual Basic GUI with C++, I see form the previous responses that it is possible, maybe even simple. Can the same be said for a Visual Basic GUI and C, not C++? any advice is appreciated.
        Although there is a lot more to it, the main point to remember is to pass strings to C routines using the ByVal keyword - this tells VB to pass it as a null-terminated string, rather than the usual format.

        Comment

        Working...