Getting a VB6 Application to Work in Windows 7 If You Can't Recompile
I have a VB6 application that still references some old VB5 libraries (dll, vbr, tlb, and ocx). We're having some strange issues like it can't read the registry using advapi32.dll. I've trie开发者_如何学Pythond running the application with UAC permissions, but still no go. We can't recompile the app because it has several controls and components that cannot be found to download and are no longer supported. Any ideas (besides a rewrite since we already are working on that) are appreciated.
To add, we've already tried this application in Windows XP Mode. However, here are my "gripes" with doing that:
- Windows that are loaded as vbFormCenter and vbModal are centered between dual monitors. Even after dragging it to one of the monitors, it doesn't remember where the modal should be.
- When trying to print, at random, it takes up to 5 minutes for a job to spit out. This is because (or at least I'm thinking this is the reason) the XP Mode machine loads printers from the host as well.
- Some DCOM communication seems sluggish at random
- A printer hooked up via USB can only be on the host or the VM and not both because it uses pass through. Even so, you can't "force" an application to allows have a printer attached.
- Older applications (VB5 and VB6) don't always close out when Application.Exit is called. Not sure why this is, but you can open up a form and call the Exit sub when a button is clicked and out of 25 times, 10-20% of the time it doesn't close. So, there is no way to show the application as a sub-process on the host machine so it can be killed.
Phew. That's just a few.
VB 5.0 is not supported on Windows 7, although VB 6.0 is, so I'm guessing that's your problem.
The solution to this is to run a windows xp virtual machine, and windows 7 has a pretty painless process for doing this using xp mode.
Check out,
http://www.microsoft.com/windows/virtual-pc/download.aspx
This may be a silly question, but have you tried running it in compatibility mode?
You could try using a windows XP virtual machine...assuming it doesn't need to run directly on the host.
An alternative to the XP Virtual Machine which has some advantages is Parallels. It's cheap, robust and offers a neat transparency mode such that the program running in the VM appears to be running as native on the desktop. I've been using Parallels on my Windows 7 computer since it came out to run several XP desktops for legacy client software development, and it works a treat.
精彩评论