VB6 to Studio '08 to Studio '10 .. What next?
-
martedì 6 marzo 2012 15:20
I have Studio 2010, I have done all the lessons in the Visual Basic "Step-by-Step" book, and I'm ready to roll!
I downloaded the Studio 2008 Express, and I suceeded in upgrading my VB6 application into an '08 project. My app has 4 forms and 1500 lines of Basic code, uses MSFlexGrid, and is on-the-whole fairly simple; nonetheless, I have hundreds of items that need correction.
I like the '10 IDE, and I would much prefer working there, but I need experienced advise. Can or should I go at once into '10 and do all my manual work in its context, or should I first clean up the '08 version to the point of successful execution? Or, perhaps, correct just the Basic coding flaws in '08, and then address control changes in '10?
Price Buhrman
Tutte le risposte
-
mercoledì 7 marzo 2012 01:39
Hello Price,
I would first backup the converted project followed by turning Option Strict On and Option Infer On followed by building the project. My guess is there will be a good deal of compile errors. Fix them one at a time i.e. if you notice one error repeated many times tackle that then rebuild and move on to another common error until there are none. This does not mean you are home free as some errors may not be noticed until testing the functionality either by you or a tester. When you have a clean build back this up. Next analyze what it will take to replace the current grid with a DataGridView, repeat testing until all works as it did (or as close as possible) in VB6. Next review project properties references, are there any references left over from VB6? Determine how to replace them with .NET counter-parts.
In regards to which version of Visual Studio to use? I would move to VS2010 keeping the Framework at 3.5. This way you get benefits of the IDE newer features over VS2008.
What is critical is after every milestone make a backup so that if something goes wrong and it takes to long to diagnose why you can revert to a backup and not lose a good deal of work.
Other considerations are, do you have On Error statements? replace them with assertion and Try/Catch statements. Finally override how unhandled exceptions are handled so that anytime there is a runtime error you did not consider the exception is written to a log file.
For database operations moving to a native data provider and leaving ADO behind is best. You will sometimes see improvements while other times no improvement but will have more resources (both people here and various web page resources) to move forward. No matter which database provider used you will find countless methods to work with data, look at several methods before deciding on one method. Many times what seems like the simple method out of many may not suit your project needs down the road.
How about goto statements? change code logic to do away with them.
If you are not sure how to fix something pop a new question here in the forums. There are many great resources (people) here that will make this much easier for you rather than attempting to did it by yourself.
Hope some of this information is of assistance
KSG
- Proposto come risposta Reed KimbleMicrosoft Community Contributor, Moderator mercoledì 7 marzo 2012 15:25
- Contrassegnato come risposta BuhrmanP mercoledì 7 marzo 2012 17:34
-
mercoledì 7 marzo 2012 17:53
Thank you for the advice! I do preserve previous work, but by creating new folders as I progress and copying all files forward as I go; I'm still unsure of how much trust I can place in the IDE's "Save Project As ..".
I do plan to move to DataGridView, but since MSFlexGrid is the essential core of my app, I would like to get to a clean compile & debug run before converting. (I did a temporary upgrade to 2010, and it seemed to accept MSFlexGrid without complaint.)
My biggest grid error appears to be with a FlexGrid "alias" object that I declared when I encountered property reference problems in modules and forms other than the one that "owned" MSFlexGrid1. Are there limiting scope problems with some controls?
Price Buhrman
-
mercoledì 7 marzo 2012 18:14
Thank you for the advice! I do preserve previous work, but by creating new folders as I progress and copying all files forward as I go; I'm still unsure of how much trust I can place in the IDE's "Save Project As ..".
I do plan to move to DataGridView, but since MSFlexGrid is the essential core of my app, I would like to get to a clean compile & debug run before converting. (I did a temporary upgrade to 2010, and it seemed to accept MSFlexGrid without complaint.)
My biggest grid error appears to be with a FlexGrid "alias" object that I declared when I encountered property reference problems in modules and forms other than the one that "owned" MSFlexGrid1. Are there limiting scope problems with some controls?
Price Buhrman
Hello Price,
In regards to the MSFlexGrid, I have no expertise with this grid as in my VB6 days we used True Grid (when moving to .NET until the DataGridView arrived we used the .NET version of True Grid). Being able to build your project with MSFlexGrid may prove to be counterproductive where your time would be better spent by replacing this with a DataGridView knowing full well that more likely than not this will be troublesome any way you approach this. Our group went thru a similar struggle moving away from True Grid and that was from VS2003 to VS2005 using a .NET version rather than a VB6 version of the grid).
KSG

