Solved

How to open form designer in VB6 project?

Posted on 2013-11-25
10
1,781 Views
Last Modified: 2013-12-04
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
Comment
Question by:Angel02
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 13

Expert Comment

by:Surone1
ID: 39676038
is it on a 64 bit computer? seems like those controls are not registered on the machine.
0
 
LVL 15

Assisted Solution

by:ChloesDad
ChloesDad earned 100 total points
ID: 39676041
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
 
LVL 16

Accepted Solution

by:
HooKooDooKu earned 300 total points
ID: 39676235
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
 
LVL 45

Assisted Solution

by:Martin Liss
Martin Liss earned 100 total points
ID: 39676313
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
 
LVL 45

Expert Comment

by:Martin Liss
ID: 39688442
Did any of the above help you?
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:Angel02
ID: 39693996
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
 
LVL 45

Expert Comment

by:Martin Liss
ID: 39694103
Can you attach your project in a zip file please?
0
 

Author Comment

by:Angel02
ID: 39695700
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
 
LVL 16

Expert Comment

by:HooKooDooKu
ID: 39695855
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
 

Author Comment

by:Angel02
ID: 39695911
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now