I was reading a little into Visual Basic and it seemed a rather simple way to implement some GUI...So I was looking for a way to interface my C++ code to a Visual Basic snippet of code. For example, receive input f开发者_StackOverflow社区rom a Visual Basic app and send it over to C++ code to continue the logic of the program based on the input of that event.
If you are talking about VB6 then the normal way is to create COM objects in C++ and use them from VB6, however I think in the long run you would benefit from - presuming Windows/Microsoft is your platform of choice - going over to .NET. You could convert your C++ code to C++/CLI and use VB.NET or better C# as GUI language. (caveat: You may also then come to like C# so much that you write the whole app in C# in the end).
You have some options :
You could create a Visual Basic GUI and create some Dynamic link libraries (DLL) for your C++ code. In order to call the C++ code, you would have to put the necessary measures so that your GUI can communicate with the C++ code.
You can drop the idea of using Visual Basic and use C++ with a cross-platform library such as Qt.
You can drop the idea of using Visual Basic and use C++ with MFC.
精彩评论