Thoughts and other stuff of interest to me, if not you :)
Running Visual Basic 6 natively under Windows 7
Published on August 21, 2010 By SEB9 In OS Customization

To start, I do not take any credit for the following information. I have followed various items covering this subject on the net and found the following combination to work for my installation.

Running Visual Basic 6 on Windows 7 can be achieved in several ways. The first one that most people will come across is to install VB 6 using VirtualXP Mode, provided you have an eligible version of Windows 7.

I've done this and for more than a year had no reason to look for an alternative. That all changed when I started to dabble in DirectX game programming. In my situation, running any DirectX application failed with DirectX failing to Initialize.

Therefore my quest to find out if a native installation of VB 6 had been discovered; started. Surprisingly, it had and it was relatively simple once all the steps were discovered. As the steps never seemed to be all together in any one article, I've decided to bring them all together here both for my future reference but also for anyone else wanting to complete the same type of install of VB 6.

Credit where credit is due:

Most of what follows is sourced from an article called "Install VB6 on Windows 7" dated 23/06/2009 - author not named.

Some from a VBMonster.com article "VB6 on Windows 7 64-bit" June 2010 - various contributors

Some from a VBWire (vbforums.com) VB Forums thread "Installing VB6 with Windows 7 (and Vista)" - various contributors

Getting Started:

Before getting down to kicking off the Installation, several preparatory tasks need to be completed first.

1. To save a lot password entry, log on or switch user to Administrator.

2. Turn off UAC (User Access Control)

A quick and easy way to start UAC is to type UAC into the Start Menu search field and press enter.

All going well, the UAC form will now show with a settings slider on the left side. Pull the slider all the way down to Never Notify.

Click OK.

3. Create a new text file and name it "MSJAVA.DLL". Copy this file to C:\Windows folder.

 

Installing Visual Basic 6

Now its time to actually get on with installing Visual Basic in a Windows 7 environment.

1. Load VB, VS CD or CD image.

Put Visual Basic 6 CD or Visual Studio 6 CD into ROM Drive

or

Load Visual Basic 6 or Visual Studio 6 CD image into your preferred program.

From the General options section of the AutoPlay popup, select the "Open folder to view files" option.

or

Cancel AutoPlay notification if you are not given that option.

2. Browse the install media and find the file "SETUP.EXE". It should be located in the 'root' or base folder.

Right Click on this file and select "Run as Administrator"

Confirm your intention.

3. The Program Compatibility Assistant will now popup.

Disregard the doom and gloom and click the "Run Program" button to proceed.

4. Follow the Setup prompts as per normal.

The install will take longer than 'normal' on the 'Checking for Installed Components' step.

Grab a cup of Tea or coffee at this point, it will be a few minutes - it was for me.

5. Once the Installation Type comes up, Select Custom.

Select the install options that suit you - I have not had any issues with installing Enterprise Edition specific options.

6. Finish installation.

Install MSDN next, as much or little as is useful.

Skip the options to install anything else unless specifically required.

Clear the Register Now tickbox - I don't think this works any longer.

7. Log off as Administrator.

The following steps are best completed using the User log on that VB6 will be normally used as.

8. The step is to setup the IDE for Windows 7 use.

Browse to the VB98 folder, by default it is C:\Program Files (x86)\Microsoft Visual Studio\VB98, and locate VB6.EXE file.

Right Click the file and select Properties. Next select the Compatibility tab.

The number options selected in this tab depends on several factors based on your setup of the IDE.

To run a stock IDE select the Windows XP (Service Pack 3) option in the Compatibility Mode area.

Click Ok.

or

If you like me run the IDE with Add-Ins that enhance the IDE, then compatibility is set slightly differently.

Select the "Change settings for all users" button at the bottom. Provide Administrator clearance.

Another Properties dialoge form will popup.

Select the Windows XP (Service Pack 3) option in the Compatibility Mode area.

Tick the tickbox in the Privilege Level area. This will allow the IDE to link to and use Add-Ins.

Click Ok and then Ok again.

 

Clean up

1. Delete the file named it "MSJAVA.DLL" from the C:\Windows folder. 


2. Turn UAC back on. Refer to step 2. of the Getting Started section on bringing up the UAC control.

 

VB Add-Ins

Many Add-Ins came in the form of a .DLL file that needs to be manually registered before it is usable in the IDE.

The registration is quite straightforward provided that it is executed correctly, otherwise a typically cryptic error message is thrown.

1. Copy Add-In files (.DLL) to the VB98 folder - by default C:\Program Files (x86)\Microsoft Visual Studio\VB98

2. Start Command Prompt with Administrator Priviliges.

Find the Command Prompt shortcut via Start Menu/Accessories

Right Click on it and select Run As Administrator

3. Navigate to the location of the .DLL(s) to be registered.

Normally the VB98 folder as per Step 1.

Its no to hard to quickly navigate with the command prompt if you also make use of File Explorer. Have File Explorer open at the folder where the Add-In to be registered is located, Click the address field at the top to have File Explorer display the path differently and highlight it. Simply copy this highlighted path.

In the command prompt window, start by changing drive if required by typing in the drive reference eg D: and press Enter. The prompt will change to reflect the change in location.

Next type in CD " and then right mouse click near where you just typed and select Paste. Then type " to close the "" section of what you have typed, and press Enter. The prompt will change to reflect the change in location.

4. Register .DLL

In the command prompt window type regsvr32 [name of your .dll file] and press Enter.

All going well a Success dialogue will show.

Repeat for other files

or

Close command prompt window

 

VB6 and Add-Ins should now work as expected. If using Add-Ins you will have to provide Administrator permission every time VB6 is started up, but its asmall price to pay for VB6 under Windows 7 without the use of VPC/VXPM, in my opinion.

I have followed these steps on my machine and all is working great. My version of Windows 7 is Professional 64bit.

 


Comments
No one has commented on this article. Be the first!