473,550 Members | 2,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

3 New Member
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
3 18098
Niheel
2,456 Recognized Expert Moderator Top Contributor
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
jmg6223
1 New Member
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
Killer42
8,435 Recognized Expert Expert
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

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

Similar topics

4
4536
by: Todd | last post by:
Is it possible to pass an argument by reference through an event in C++ managed code? For example, can I do the following? public __gc class MyClass : public Control { public: __event void MyEvent(bool &Cancel);
23
12243
by: John | last post by:
Last year, I remember finding a web page describing how to pass the name of a file to another web page, and have that web page load that image file. Now, I can't find my record of that (it was saved on another computer that I can't get to right now), and I can't remember what search parameters I used to find it when I googled the topic. ...
1
7657
by: Mark Dicken | last post by:
Hi All I have found the following Microsoft Technet 'Q' Article :- Q210368 -ACC2000: How to Pass an Array as an Argument to a Procedure (I've also copied and pasted the whole contents into the bottom of this email)
19
9491
by: David zhu | last post by:
I've got different result when comparing two strings using "==" and string.Compare(). The two strings seems to have same value "1202002" in the quick watch, and both have the same length 7 which I have tried to print out by debug.writeline(). But the "==" operator results false, and string.Compare() results true. Somebody helps me!
7
3883
by: TJ | last post by:
In C# how do you achieve pass-by-reference property declarations in the Type Library? I am writing a COM Class Library that must mimick an existing library for which the only information is the TypeLib. I'm using Visual Studio .NET 2003. The original library provides simple authentication services, from Access and MS-SQL OLEDB providers....
8
4344
by: Two Beards | last post by:
Hi, I'm new to VB and .net so I may be mising something. I am trying to dynamically build some SQL by appending to a string. Part of the SQL comes from an mp3 id tag I have extracted from a file and stored in a string. I can do all the normal stuff with the string like msgbox and I can append it to another string but I cannot append to the end...
4
2851
by: kimberly.walker | last post by:
Im very new to coding in C++ so use to coding in C#. My question is how to pass some values (string) from unmanaged code to managed code. I have two source files on a win32 console application one I used #pramga managed to change to managed code but I need to get the values from the unmanaged code and pass it to the managed code. Thanks...
2
2920
by: mrmwalter | last post by:
Hi, I have a simple form. On it is a Text Box that asks for "Username to be entered". It also has a Radio Button that asks if the user needs to be added to the local admin account. I have an external vbs that adds user to local admin account, but how do I pass the vbs the "UserName" that is entered on the form, if also admin radio button...
14
4810
by: Siegfried Heintze | last post by:
Why does VB.NET V2 force me to pass by value for my set function? When I try to change it to const byref it gives me a syntax error. It seems very inefficient to be passing strings around by value when a reference to a constant string object will do fine (all we are going to do is copy it). In my case, would the byval for the set function...
0
7490
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7765
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8001
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7520
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6104
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5404
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3533
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1980
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
802
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.