Converting from VB to C++

Is there is a more-or-less automated conversion utility that will take runnable VB5 code and convert it to C++?

We have a farily simple application that was written in VB5 Pro that we want to port to C++. Is this hard/easy/trivial/impossible? What are considerations, drawbacks, etc.

Discussion please...
LVL 12
mark2150Asked:
Who is Participating?
 
MirkwoodConnect With a Mentor Commented:
I'm not really sure I deserve the points but OK.

Create an MFC or ATL application
In developer studio, choose Insert/resource, click  import and select VBForm in the types. Now insert the form.
When you double click, MFC will create a class. Connect the control to the corresponding controls.
Now you have to find an event that looks like the VB events you are trapping.
0
 
jkrCommented:
It definitely IS possible. The main consideration is that things will definitely get more complicated (also tha main drawback)...
0
 
Tommy HuiEngineerCommented:
It is possible, but you are probably never going to find one. The reason is that there are multiple ways of creating a Windows C++ application and each of them is different depending on which compiler you use. For example, would the code be changed to OWL (BC++), MFC (BC++ or VC++), or VCL (BCB), or even C/SDK?

To be fully generic, the conversion utility would probably choose C/SDK to support all the C++ compilers. Then the generated code will need to have all the code necessary to support ActiveX controls. Not too many people are willing to write that code.

My suggestion is to ask yourself why you need it in C++. Is it because the application is too slow? If so, then I would maintain the UI in VB and have the VB program use DLLs written in C++ for speed. Another possibility would be to use C++ to write COM servers to do the work and have the VB program use that instead.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
mark2150Author Commented:
Thanks for the input, but I'm rejecting to keep the question open for discussion. I'll give you the points later if the discussion peters out without any more informative answers.

I'm helping out a friend in her computer class. She has an assignment to use C++ to develop a simple app. I'm not a C programmer, but I said I could easily code it in VB so she could use my stuff as a template.

Then the question arises about what is involved in the conversion? I'm building screens in VB and *hoping* that we can port to VC without a *HUGE* investment in time.

Funny thing is, the assignment is kind of silly. Speed is not an issue. But the way the assignment is phrased is very DOSish (if that makes any sense...) You know, the program spec says "Menu options numbered 1 thru 5". It's a silly little database app with 1 being add a record, 2 being edit, 3 being delete, 4 print and 5 exit. Only thing is that with VB you normally exit with [X] or use a button. The Add/Edit/Delete screens I would normally code as a single screen with some option buttons but the way the problem is phrased precludes this.

Makes me wonder if our colleges aren't prepping people for programming in the 70's instead of the 90's...

Anyway, any other tips on porting from VB to VC? Can we re-use forms and such? Do the event calls change much? how about accessing an Access Database file?

M

0
 
Answers2000Commented:
Automated converter VB - > C++

Homer by CiceroSoft (German company)

    English version of their home page is
    http://www.cicerosoft.com/eindex.htm 

    Can't give you a more exact URL because of the use of frames on their site but should be easy to navigate to it.

    There is a download version you can evaluate for 30 days.




Another idea - presumably you are porting to C++ for portability (?) or perhaps for another reason (?).  if the first reason, Java is also an option...

To convert VB to Java

Instant Basic for Java V1.2 by HALCYON SOFTWARE

The professional edition includes additional database and professional control capabilities including support for DAO and RDO. It will convert existing Visual Basic source code to Java source code</B>…and it comes a pure Java certified Installer to create your installation software for Java software.

Standard Edition:
http://www.beyond.com/AF11804/PKSN101020/prod.htm

Prof edition:
http://www.beyond.com/AF11804/PKSN101017/prod.htm


0
 
mark2150Author Commented:
Ok, last try.

Cicero seems like a good concept, but (gasp) almost $5000 for a college project is wayyyyy out of line. I couldn't find the "30 day eval".

I was hoping someone was going to say something like "Copy the forms & rename them xxx",  "Change all of the xxxx statements into yyyy".

I'll close this tonight and award if there are no other ideas.

Thanx!

M

0
 
woffCommented:
VB Forms are totally different from Visual C++ resource scripts. Their both in a text format, but that is where the similarities end.

Copying the forms is the easy bit, how long can it take to draw a couple of forms in C++? The problem is porting the code.

The basis behind the languages is the same, they both use api's and work around a simple messaging system, but to convert from one to the other, is a massive job. If you found a tool for $5,000 I would beleive it!

Good Luck!
0
 
MirkwoodCommented:
VC allows you to import the VB forms. So that is no problem. the code is what you have to do yourself. But most likely you'll find similar events in VB and MFC or ATL.
0
 
pagladasuCommented:
I guess that instead of trying to develop the app in VB, you may explain the logic to your friend, and if she is good enough in C++, she will be able to develop it.
0
 
mark2150Author Commented:
Ok. Mirkwood, thanx for your response. That was the kind of answer I was looking for. Can you explain the import process (is it just click & drag or is there a hook?) in an answer & I'll award the points. Everyone else who responded: I'll post a series of "for xxxx" questions with some points for each of you - Thank you for your time!

M

0
 
mark2150Author Commented:
Although the answer is not a *happy* answer (click HERE & all will fix! {grin}) it is a good answer to what I asked. Thanks to all that posted.

M

0
All Courses

From novice to tech pro — start learning today.