By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,694 Members | 2,122 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,694 IT Pros & Developers. It's quick & easy.

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

P: 3
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.
Jan 14 '06 #1
Share this Question
Share on Google+
3 Replies


Expert Mod 100+
P: 2,324
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.
http://www.flipcode.com/articles/article_vbdlls.shtml

Here is another article that shows you can call a C++ DLL from visual basic.
http://www.developerfusion.co.uk/show/1973/1/

When you get it to work, please let us know . . . paste some sample code for the rest of us.
Jan 17 '06 #2

P: 1
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.
Oct 9 '06 #3

Expert 5K+
P: 8,435
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.
Oct 19 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.