Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2535
  • Last Modified:

How to open form designer in VB6 project?

I am trying to work on a VB project folder. It has a .vbp file and a couple of .frm and respective .frx files.
I opened the .vbp file using Microsoft Visual Basic 6.0 (SP6).
It opens the code windows for all the forms present in this application. I now want to look at the form design. When I go to the folder and double-click the .frm file and it says "Error during load.."
When I check the corresponding .log file I find a bunch of errors like attached.

What am I missing? Please advise.
EE-Error.txt
0
Angel02
Asked:
Angel02
  • 3
  • 3
  • 2
  • +2
3 Solutions
 
Surone1Commented:
is it on a 64 bit computer? seems like those controls are not registered on the machine.
0
 
ChloesDadCommented:
It means that the controls that are required by the form have not been loaded in the project. This could be due to then not being available on the PC or being in a different location.

This is quite normal if you are loading a project on a new PC and can be easily fixed by adding the appropriate controls to the project.

Do not save the frm files as this will cause them to be saved without the controls that caused errors during load
0
 
HooKooDooKuCommented:
As the others have stated, the controls referenced by the project/form files are either not installed on your machine, or the ones installed are not the correct versions.

Because all of the controls look like controls that come with VB6 (at least the "professional" version, can't speak for "educational" or "free" versions of VB6), it is my guess that you have not installed the same service pack that was installed on the machine that created the VB project/form files.

My advice would be to start by making sure you have the latest VB service pack (SP6) installed on the machine.  If the project/forms still will not properly load, try the following steps.

1. Create a blank project and right click on the "Toolbox" window to display the "Component..." window.  Make sure the following Microsoft components are selected:
Microsoft Common Dialog Control 6.0 (SP6)
Microsoft FlexGrid Control 6.0 (SP6)
Microsoft Hierarchial FlexGrid Control 6.0 (SP4)
Microsoft Windows Common Controls 5.0 (SP2)
Microsoft Windows Common Controls-2 6.0 (SP6)

You might not need the Microsoft FlexGrid Control 6.0 (SP6) and the exact service pack numbers might be different on your copy.

2.  The Toolbox should now have some additional controls.  Drag and Drop at least one instance of the following controls onto the Form of your blank project (hover over the controls in the Toolbox to get their names to display):
DTPicker
CommonDialog
ProgressBar
ImageList
MSHFlexGrid
StatusBar

3. Save the project.

4. Open the newly saved VBP and FRM files in NotePad to see how these components are referenced in your new files.

5. Open the old VBP and FRM files that are currently failing in NotePad to see how the old project references these components.  Then use NotePad to copy the references as they appear in the new project/form to the old project/form.

6. Save the modified VBP/FRM files and attempt to reopen the failing project in VB.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Martin LissRetired ProgrammerCommented:
Here's another approach. After you open the project you'll most likely find that several of your controls have been change to image controls, or is it picture boxes - I forget. In any case delete one of them and replace the control from the toolbox or Project}Components giving the new control the name of the one it's replacing. When you have replaced all the problem controls, save the project (to be careful under a new name).
0
 
Martin LissRetired ProgrammerCommented:
Did any of the above help you?
0
 
Angel02Author Commented:
Thank you for the replies.
I think I am missing something here.

I first went ahead and ran VB6 SP6 to make sure I had the right version. FYI, it is a 64 bit machine. The about section on VB6 looks something like attached.
I then tried what  HooKooDooKu suggested. In the component window I don't find any components that HooKooDooKu  mentioned. Is it the version?

Then I tried what  MartinLiss mentioned.
@ MartinLiss: which controls are your asking me to delete? I am not able to open the form at all in the designer. All I see if the code. How do I open the form?
vb6.png
0
 
Martin LissRetired ProgrammerCommented:
Can you attach your project in a zip file please?
0
 
Angel02Author Commented:
OK this is what I did to make it to work. Opened .vbp file of my project in VB6. That opened all the code windows of all the forms in the project. Then selecting one code window I went to View -> Object.
This opened the form window of the selected code window. This is what I wanted to get to know which button on the form goes to which method in the code.

Does this look right? Please advise is anything.
0
 
HooKooDooKuCommented:
Your 'About' window seems to indicate you've got the right version of VB6.  My 'About' window is just about identical.  The only difference (other than the licensed info) is that I have "Forms3: 12.0.6604.100".

While the Forms3 isn't a perfect match, I don't think that is really going to be your problem.  Your problem is GOING to be these missing components.  Without them, you will never get the project to successfully load and compile.  Think of it this way - your VBP references a set of 3rd-Party ActiveX controls (it's just that Microsoft is the creator of these controls).  If you don't have these 3rd-Party controls properly installed on your computer, then there is no way the project file will successfully open.

If you can't find these components in the "Components" window (on the "Controls" tab)...
  Microsoft Common Dialog Control 6.0 (SP6)
  Microsoft FlexGrid Control 6.0 (SP6)
  Microsoft Hierarchial FlexGrid Control 6.0 (SP4)  
  Microsoft Windows Common Controls 5.0 (SP2)
  Microsoft Windows Common Controls-2 6.0 (SP6)

...then try clicking the "Browse..." button ("Controls" tab of "Components" window) and search for the following files (perhaps in different folders):
  C:\WINDOWS\system32\COMDLG32.OCX
  C:\WINDOWS\system32\MSFLXGRD.OCX
  C:\WINDOWS\system32\MSHFLXGD.OCX
  C:\WINDOWS\system32\COMCTL32.OCX
  C:\WINDOWS\system32\MSCOMCT2.OCX

What might be your problem (in addition to the missing controls) is the fact you are trying to run this on a 64-bit machine.  From what I understand, Microsoft "officially" says that VB6 will not work with say Windows 7.  But I've also found places like this:
http://stackoverflow.com/questions/2501061/does-the-vb6-ide-run-on-windows-7-64-bit
that says it is possible.

At a minimum, you need to see if you can find the above listed OCXs on your machine.  You might have to eventually jump through more hoops to get VB6 running on a Windows 7 machine.

I can tell you that my personal solution when we moved to Windows 7 (where I would have modern versions of Visual Studio installed) was to run VB6 in a "Windows XP Mode" virtual machine within Windows 7.  But you had to have something like "Enterprise" version of windows to be able to do the Virtual Machine.
0
 
Angel02Author Commented:
It seems to be working now. I am not sure what went wrong with the previous project version. I made a new copy of the project and it has all the components you mentioned. It also opens the form in designer.
For now I am using Windows XP 32-bit. However we will need to go to Windows 7 soon. Hopefully it works as mentioned in the link your provided.

Thanks all!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now