Solved

Installing VB6 on Windows 7

Posted on 2013-01-03
4
790 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
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…

743 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

13 Experts available now in Live!

Get 1:1 Help Now