Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

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.

thanks,
newbieweb
ASKER CERTIFIED SOLUTION
Avatar of ladarling
ladarling
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of curiouswebster

ASKER

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:

username-dept1-02

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.

newbieweb
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:
http://msdn.microsoft.com/en-us/library/aa772170(VS.85).aspx
http://technet.microsoft.com/en-us/library/bb742578.aspx
Some C++ Specific Code:
http://www.isocra.com/2005/04/adsi-from-cpp/
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 :-)