Need to convert from VB.NET to C++

I have be given the task to  convert a newly finished Windows app (using VB.NET)  to  C++ because of resource limitation on the target machines which prevent .NET from being loaded.  So the solution that's been made is to use C++ and take advantage of the higher performance and lower resrouce requirement of C++.  SO  I need some advices about the major steps in this process ASAP.

The application involves networking and ActiveDirecctory, yet I have had virtually no experience with either.  I will have the VB.NET source code, but I'm afraid it will have little value because I presume it makes extensive use of the .NET Base Class Library.  And those objects would need to be re-written from scratch or  found in some C++ library, if there are any around these days.

If you were handed this task, what major steps would you take to fulfill this assignment?    I can use MFC is I want, so there may be enough tools there to satisfy my needs, but I do not know for sure.

But please keeep your advice high level for this first pass.  I need to present some ideas at a high level first.

newbiewebSr. Software EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I assume that you are an accomplished C++ programmer, and that you have no problem reading VB code. I would start with a full analysis of the present applications scope and functionality. Even though this is a rewrite, you already know that much of the existing app is going to be lost in translation. To begin with, I would:
-Identifying the applications dependencies and references (data sources, SDK's (WebDAV, etc) that can be reused in C++ syntax for the new application).

-Scrubbing the printed VB source code for functions that you can reproduce from known C++ entities (iostream.h, MFC's, etc.) and mark them up as such.
-Take another pass through to document functionality for which you cannot directly identify the C++ analog. This phase is going to give you and the intended users an initial understanding of the time line.
-Write up a development plan or flowchart for the modules of the application that are going to be complete rewrites. This will give you a much more accurate idea of the timeline.
If you can duplicate the logic you encounter in step two for known functionality then that is just translation, and should be quick and painless. The bulk of your work is going to become identifying packages that can help replicate the rest of the functionality, and of course interface design. In this scenario I would imagine that you will lean heavily on MFC, since the .NET languages allow programmers to throw tons of UI widgets into the mix. I would make sure you tell management/end users to expect the more streamlined native GUI, and not let them get hung up on any .Net eyecandy.
My best advice is to treat it like you are porting it, which is actually what is really happening. A work-alike is fine, dont get bogged down with nuances. If you know a similar way or a workaround to a problem that the original app solves, do it the C++ way and drive on.

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
newbiewebSr. Software EngineerAuthor Commented:
Thanks for  the feedback.  I now have a better understanding of the problem.

There are literally two input fields:

Textbox - username
Department -  drop down (The drop down's populated with LDAP)

User enters username, selects department, then clicks Next.

At that point the program creates a name that's unique on the network:

username-dept1-01 (for example)

then sets the machine name to that new name.  If the person brings another machine on the network, the  program names it:


and sets the second machine to that name  That's it!

The guy who wrote the VB.NET said the code's not important and it's probably a total rewrite.

Now that I've scaled  down the  problem, how would you approach it?  It does alsso involve ActiveDirectory.

I've had no experience with ActiveDirectory, LDAP or even writing C++ for networking.  I wonder how difficult  it  might be for me to incorporatet these technologies?

I'd  love to hear your approach to solve this problem.

As for the networking aspect of it, dont sweat that. Let COM take care of that for you.
I would instead focus on Active Directory Services Interface (ADSI) first thing. The specific functionality you are after is not terribly difficult to accomplish, but I personally would take the time anyway to fully understand the mechanics of ADSI so that you dont get stuck without knowing where to look for help. Let the customer know that you are going to need so lead time to get up to speed on the technologies involved.
Some good introductory material:
Some C++ Specific Code:
If the VB.NET programmer was using System.DirectoryServices then you should be able to get equivalent COM functionality from ADSI.
Once you get a handle on the symantics, check out how other people have done it. Even the VBScript code out there helps to get an understanding of whats possible since its using the same components as what you are after.
For full disclosure's sake, I will tell you that I have never tried to code against AD from C++ either. But, with the glut of information out on the net, I bet its going to be a really shallow learning curve.
And, if you do run into any problems along the way, you have hundreds of experts here just waiting to help out :-)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.