UltimaSerial How to upgrade VB6 program to Visual Basic 2008
Data logger


Windaq add-ons
Windaq Add-ons




Ultimaserial XChart




Ultimaserial Classroom


Visual Basic 2008 example projects

Since Visual Basic 6 has been discontinued by Microsoft, and Visual Basic 2008 Express Edition is FREE for downloading, many people will be using Visual Basic 2008's upgrade wizard to upgrade the VB6 examples provided in the installations of Ultimaserial, UltimaWaterfall and XChart. When you do so, please note:

  1. Once conversion is done, pay special attention to all the UPGRADE_WANRNINGs
  2. VB6 allows variables to be used before definition. When these variables are converted to VB2008, they will be defined as Objects. Please redefine them according to their true nature
  3. Special consideration regarding variants. For example, we use V = UltimaSerial1.GetDataFrame(1024) to acquire data in VB6,  this places the return from GetDataFrame to the variant V. In VB2008, you must predefine V as Dim V(,) before using it, see VB2008 projects below
  4. In VB6, Form.Load is the entry point of the program.  But in VB2008, events for option buttons may be fired before any code in Form.Load is executed. To prevent accidental use of unintialized variables, please search for warnings like "'UPGRADE_WARNING: ... may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"' ", add some logic to block such execution sequence when necessary (refer to VB2008 projects below):
    • Add a boolean variable, formdone, to the declaration section of Form, which will be initialized to FALSE by default
    • At the end of Form.Load, add

      formdone = True

    • In each place that has above warning, add the following code so that it will NOT proceed if formdone is FALSE:

      If formdone = False Then Exit Sub

  5. Watch out for ReDim, VBX2008 does NOT support ReDim the same way as VB6, so you may need to rewrite some codes (see demo_xchart for reference)
  6. You can't reverse the min/max in scroll bar, so you may need to rewrite some codes (see demo_xchart for reference)
  7. Redo the GUI layout

Here are several VB2008 projects for reference

Last update: 02/29/12