Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Installing VB6 on Windows 7

Posted on 2013-01-03
4
Medium Priority
?
822 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

While working, an annoying popup showing below will come and we cannot cancel or close it form the screen. The error message will come again and again.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.
Suggested Courses

688 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