I was given a half-finished project to finish. It was written in C++ using Visual Studio 2005.
Is it possible to somehow continue the project in VB.Net? If it is, can you guide me?
Thanks
I was given a half-finished project to finish. It was written in C++ using Visual Studio 2005.
Is it possible to somehow continue the project in VB.Net? If it is, can you guide me?
Thanks
Assuming you're talking about VB6, you have to compile your c++ project as a dll file with extern "C"
decorated outputs. That means functions only, no classes at all. If you can make your project work like that, it's the easiest way to integrate it in vb6, just look up Declare Function/Sub
and translate the declarations as appropiate.
Now the other way, which includes working classes, is to expose COM objects from your c++ project, and in VB6 you just add a reference to it and use it as you would any VB6 class. It's however a lot more work.
I've had success at doing this in Visual Studio, though my scenario may be somewhat different.
I was given an existing C++ app to add functionality to, and decided to implement the new features in C#/VB. In the General properties for the app, I changed my "Common Language Runtime support" setting to /clr. I then created my new classes in C# and VB and linked them in using the "Resolve #using References" section on the "C/C++" node of the project properties.
This did not eliminate the need to write C++, as I still needed to code some C++/CLI to integrate the two parts of the app, but it did let me write most of the new functionality that I wanted to write in languages that I'm more productive in.
Of course, this could get annoying if you have half-implemented objects in C++ and you want to implement the other half of the same in VB, in which case this method might get quite annoying to use and maintain.
If the app isn't done, then I don't recommend trying to do the "rest" in VB unless there's a reasonable segmentation of the existing and new code such that you could turn the existing C++ stuff into a library to be used by the VB code. But only if it makes any kind of sense (think encapsulation here -- is the code suitable to stand (or at least lean) on its own?)
Otherwise, it sounds like a maintenance nightmare, where parts of a routine are in one codebase and parts are in another and debugging and enhancing become 10x as hard.