Deploying VB Applications
Deploying VB Applications
VB6 applications require the Visual Basic runtime (msvbvm60.dll) and any referenced COM components to be installed on the target machine.
Package and Deployment Wizard
The built-in Package and Deployment Wizard (PDW) creates installers:
- Open VB6 and load your project.
- Go to Add-Ins → Package and Deployment Wizard.
- Select Package to create a distributable.
- Choose Standard Setup Package.
- Select the build folder.
- The wizard detects dependencies (DLLs, OCXs, runtime files) and includes them.
- Choose Single cab for CD/network distribution or Multiple cab for floppy disks.
- Click Finish. The wizard creates
setup.exeand associated.cabfiles.
Required Runtime Files
| File | Description |
|---|---|
| msvbvm60.dll | VB6 runtime (always required) |
| oleaut32.dll | OLE Automation (usually present on Win2K+) |
| olepro32.dll | OLE Property support |
| mscomctl.ocx | Common controls (ListView, TreeView, ImageList) |
| mscomct2.ocx | Additional controls (DatePicker, MonthView) |
| comdlg32.ocx | Common Dialogs (Open, Save, Print) |
| mswinsck.ocx | Winsock control |
| msado28.tlb | ADO 2.8 type library |
COM Registration
ActiveX DLLs and OCXs must be registered on the target machine:
REM Register a COM DLL regsvr32 MyComponent.dll REM Unregister regsvr32 /u MyComponent.dll
Troubleshooting
- "Component not registered": Run
regsvr32on the missing DLL/OCX. - "Run-time error 429: ActiveX component can't create object": The referenced component is not installed or registered.
- Version conflicts (DLL Hell): Ensure the correct version of shared components is installed. Use the PDW to deploy the correct versions.
- Windows XP compatibility: VB6 SP6 applications are compatible with Windows XP. Set the compatibility mode in the manifest if needed.