Solved

Installing VB6 on Windows 7

Posted on 2013-01-03
4
804 Views
Last Modified: 2013-01-05
I have a proprietary software that I wrote in vb6.  I need to keep using it on my windows 7 machine but I have two questions:
1) Is it safe to install vb6 on the machine.
2) I get a "User-Defined type not defined" when I try to run it and it appears to be targeting my sst (tab) object.  

Any guidance would be much appreciated.
0
Comment
Question by:Bob Schneider
  • 2
  • 2
4 Comments
 
LVL 29

Assisted Solution

by:Randy Downs
Randy Downs earned 500 total points
ID: 38742394
Maybe this will help
http://stackoverflow.com/questions/4677752/user-defined-type-not-defined-error-in-vb-6-under-windows-7

The compiler is automatically highlighting the first line of the function declaration for you when the error appears. That means the error occurs somewhere within that line. Sometimes that's not as helpful as you'd like, but in this case, it manages to tell you quite a lot.

Specifically, the only "user-defined type" (really, the only "type" at all) that appears in the function declaration is MSComctlLib.Button. What the compiler error message is telling you here is that it doesn't know what a MSComctlLib.Button is. It therefore assumes it's a "user-defined" type because it often doesn't know what the user is talking about. :-)

Either way, the fix is simple: you need to tell the compiler what an MSComctlLib.Button is. In this case, it guessed wrong in assuming that it is a user-defined type. It's actually a button control provided in the Microsoft Windows Common Controls Library. To tell VB 6 about this control, you need to add the corresponding component to your project. Follow these steps:

From the "Project" menu, select "Components".

In the dialog box that appears, scroll about 2/3 of the way down the list to the M's. Place a check by both the "Microsoft Windows Common Controls 6.0" and "Microsoft Common Controls-2 6.0" items. (Don't worry if yours have a different service pack designation.)

     

Click the OK button. If you're quick, you'll see some additional controls being added to your toolbox. These are the controls provided by the component libraries that you just added. Among those controls is one called Button.

Finally, try to compile and run your project again—everything should be fine this time, because now the compiler knows what the MSComctlLib.Button type is. In case you still don't, it's a button that appears on your toolbar. The toolbar control is provided by the Common Controls library, and it includes a type that defines an individual button appearing on that toolbar.
0
 

Author Comment

by:Bob Schneider
ID: 38742403
Thanks!  However when I do that i get an "error accessing the system registry error...
0
 
LVL 29

Accepted Solution

by:
Randy Downs earned 500 total points
ID: 38742413
Maybe this will help

http://www.vbforums.com/showthread.php?639971-Errors-when-loading-VB6-project

Did you install the most recent VB service packs too? Are you reregistering the non-VB controls (regsvr32) with elevated privileges? Note that removing/re-adding some controls may be needed. Take my button control for example. The one you downloaded and compiled may not be the same version you originally had.

Is this a 64 bit o/s? If so, give forum quick search for regsvr32 and 64 bit. I recall seeing something not too long ago about differences.

Tip: Try with a fresh project and add some of those components? Errors or no?
0
 

Author Closing Comment

by:Bob Schneider
ID: 38747321
Thank you so much!!
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

680 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