all i wanna do is make a visual basic form with 1 button so a C++ program will execute.
anyone know how ?
How to combine C++ and visual basic?
Assuming I understand you correctly: you have, or will write a vb program with a form. On the form is a button that you want to execute a c++ program. Another thing: I figure this is vb6, not vb.net. Assume that the c++ program has been compiled/linked to a .exe file. The take a look at the shell command in vb help. It's something like
rv = Shell(RunCommd, style)
Shell runs an executable program and returns a Variant (Double) representing the program's task ID if successful, otherwise it returns zero. That'll do ya.
If it's vb.net, you'll probably want to get into ShellExecute or find the .net call that does the equivalent; can't remember right now.
Reply:There're two combination: use C++ method in VB, or use VB method in C++, the principle of both is same.
Create a DLL(dynamic link library) project and build it, it'll make a DLL file, which is complied to be a binary file,so it could be used under any perform or lanuage.
Of course different language has a different way to define or import a dynamic library, so all I can tell you is a general path to combine C++ with VB:built a DLL , upload the Dll method in your program.
Reply:I don't know if this will help, but if you search www.download.com for a c complier, you will come across a program that compiles c code from basic. ( I don't know if it's visual basic or the old ms-dos based basic though. )
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment