Solved

Need to convert from VB.NET to C++

Posted on 2008-09-30
3
898 Views
Last Modified: 2013-12-14
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
0
Comment
Question by:newbieweb
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
ladarling earned 500 total points
ID: 22608471
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.
0
 

Author Comment

by:newbieweb
ID: 22609359
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
0
 
LVL 11

Expert Comment

by:ladarling
ID: 22614390
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 :-)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now