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

x
?
Solved

Installing VB6 on Windows 7

Posted on 2013-01-03
4
Medium Priority
?
829 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 30

Assisted Solution

by:Randy Downs
Randy Downs earned 2000 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 30

Accepted Solution

by:
Randy Downs earned 2000 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

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!

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Simple Linear Regression

772 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