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
Solved

Installing VB6 on Windows 7

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

OfficeMate Freezes on login or does not load after login credentials are input.
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
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…

856 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