The new vbAccelerator Site - more VB and .NET Code and Controls
 Installing, Registering, COM and VB
  Building a VB6 Binary from a VB5 ActiveX Project  
  VB makes components easy: pity it doesn't do the same for source code. Here's how to convert a VB5 binary to VB6  
 

I Want To Take You To Another Level

"Thy purpose firm is equal to the deed: Who does the best his circumstance allows does well, acts nobly; angels could no more."
   -Edward Young (hardcore VB coder) 1684-1765.


VB5 vs VB6
Most important thing is I don't own VB6. (Or, VB5.2 as I prefer to call it). I should get it soon, but I'm really waiting for VB7 because good VB releases always have odd numbers. Its true!

I'm beginning to ship VB6 binaries because readers are helping me. But basically most things compiled are VB5. Even if there is a newer VB6 version of certain DLLs, none of the VB5 libraries will ever reference the VB6 version:

a VB6 binary cannot be compatible with a VB5 one because it requires MSVBVM60.DLL not MSVBVM50.DLL Therefore if I've released a VB5 version, it must run with a VB5 compatible DLL set, and likewise for a VB6 version of a project it must run with the standard VB6 runtimes.

Moving On Up
So despite how much you'd like to just move from the VB5 version to the VB6 one, that isn't going to happen. (And it isn't going to happen when we move from VB6 to VB7 unless Microsoft come up with a blinder in DLL technology). So, how do you move from a prior VB version to a newer one? To a greater or lesser degree, that task can be done automatically for you when you move from the Microsoft supplied VB5 to VB6 controls. However, there are no such behind the scenes fix-up tools when using vbAccelerator source code (MS dragging their feet again. Answer my emails you monopoly-controlling coders!) Therefore there is a certain amount of dull and manual work to be done.

If you follow these steps though, you are likely to get the code running more quickly:
  1. Ensure VB5 run-time libraries are installed
    It cannot hurt! By ensuring this code is installed, you can register controls built in previous editions and run the binaries compiled in those editions. See Installation for details on how to download the VB runtimes for various versions.
  2. Download and register all the relevant DLLs
    That includes particularly the VB5 version of SSubTmr.DLL. Download and register the VB6 version at the same time! For more details about registering and registration problems, read the article about it.
  3. Open the project in VB6
    If there are errors then VB6 is looking for the compatible OCX in the wrong place, for example, it may be that you have not created the "Release" subdirectory in the right place or that the VBP file is pointing to the wrong "Release" subdirectory. All my control and DLL projects assume that there will be a copy of the latest binary, VB5 version, registered, under a subdirectory of the project's VBP file called "Release".

    If you still can't get started without error remember that the error you get is only that the VBG cannot interpret the control project. You can fix this problem simply. Normally you delete the PictureBox with an instance of the local control then remove any Project->Components links to the old version. If there isn't a PictureBox then you can just select the new VBP in the menu.
  4. If the project uses the SubClassing and Timer Assistant
    Reference to the correct version. There are two steps:
    • Choose Project->References..
      Browse..
      pick SSubTmr6.DLL
    • Search and Replace SSubTimer with SSubTimer6 (to change ProgID where VB requires it).
  5. Now Run Your Project!
    Everything should work fine. If the control doesn't size correctly, that is because of the unexpected and bizarre change of order in VB6 of the Resize and ReadProperties events. Add the following line to the end of the UserControl_ReadProperties event to fix it:

          UserControl_Resize

Remember - vbAccelerator is not saying you can have plug and play VB6 binaries right now. That can't happen full scale until I get VB6. Until then we do what we can!




TopBack to top
BackBack to Installation
BackBack to Home

 
 

About  Contribute  Send Feedback  Privacy

Copyright © 1998-1999, Steve McMahon ( steve@vbaccelerator.com). All Rights Reserved.
Last updated: 15 November 1999

llspacing="0" width="100%">  

About  Contribute  Send Feedback  Privacy

Copyright © 1998-1999, Steve McMahon ( steve@vbaccelerator.com). All Rights Reserved.
Last updated: 15 November 1999