Microsoft KB Archive/138531

= How To Port VB 3.0 projects w/ .Vbx to VB 4.0 16-bit & 32- bit =

Article ID: 138531

Article Last Modified on 7/1/2004

-

APPLIES TO


 * Microsoft Visual Basic 4.0 Standard Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 16-bit Enterprise Edition
 * Microsoft Visual Basic 4.0 32-Bit Enterprise Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition

-



This article was previously published under Q138531



SUMMARY
You can convert existing Visual Basic 3.0 projects into projects that can be loaded in Visual Basic 4.0 (both 16-bit and 32-bit versions). If a Visual Basic 3.0 project that contains .vbx files is loaded in Visual Basic 4.0, Visual Basic 4.0 (both the 16-bit and 32-bit versions) automatically "morphs" the .vbx file into the corresponding .ocx file (16-bit or 32-bit) in the new project as long as there is an entry in the Vb.ini file that allows Visual Basic to know which .ocx file the .vbx file should be "morphed" to. Also, you should make sure that the .ocx file pointed to in Vb.ini is in the location specified. The 32-bit edition of Visual Basic 4.0 requires that all Visual Basic 3.0 forms be saved as text for the conversion to work correctly.



MORE INFORMATION
For example, if an existing Visual Basic 3.0 project contains Threed.vbx, the corresponding entries must be present in Vb.ini for both the 16-bit and 32-bit versions of Visual Basic 4.0. Both versions of the threed .ocx file should be present in the specified directories:

16-bit
[VBX Conversions16] threed.vbx= {0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#1.0#0;C:\WINNT35\SYSTEM\threed16.ocx

32-bit
[VBX Conversions32] threed.vbx= {0BA686C6-F7D3-101A-993E- 0000C0EF6F5E}#1.0#0;C:\WINNT35\System32\threed32.ocx

When you try to open an existing Visual Basic 3.0 project with .vbx files in Visual Basic 4.0 (16-bit or 32-bit), a dialog box with a list of all custom controls to convert is displayed and will prompt you to make the conversion. If you choose to make the conversion, the corresponding .ocx files will be automatically included in the new Visual Basic 4.0 (16-bit or 32-bit) project. If you choose not to convert, Visual Basic 4.0 16-bit will retain the original .vbx files in the new Visual Basic 4.0 project, but Visual Basic 4.0 32-bit will simply not include the original .vbx files.

All .vbx files that are to be converted must exist on the computer where the conversion is taking place. If one or more .vbx files are missing, Visual Basic 4.0 will give the following error message for each missing .vbx file:

File not found: 'vbxname.vbx' -- Continue Loading Project?

There is no way to avoid this message other than by ensuring that each .vbx file is present on the system that is performing the conversion.

Keywords: kbhowto KB138531

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.