VB6 Runtime Issue on Windows 7 64bit

I have some older VB6 Code.  I installed the lastest patches for Windows 7 64bit, Visual Studio 6, etc.  

I turned UAC off, but that doesn't seem to be an issue anyway.   My initial problem was the get registry was looking in HKLM>Software>MyApp, which needs to be HKLM>Software>Wow6432Node>MyApp...

After making this change and testing through Visual Studio 6, the registry entry was found and all was well.  I then saved the project, compiled and created package.  Then Deployed package and after running from start menu I get the error I did before when the registry entry was in the wrong place.  I tried to run just the .exe by itself and same thing.   Went back to Visual Studio 6, and it runs fine.  Double-checked I saved code, compiled, built new package, uninstalled previous package, rebooted, installed new package and get same error coded in .bas module.  What gives???
66chawgerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GrahamSkanRetiredCommented:
Can you tell us what the error is and what instruction is being executed?
dmcgurimanCommented:
is the installer 16-bit?
66chawgerAuthor Commented:
Dim oReg As WinReg.Registry
   
    'Create a instance of the Registry object, assigned to oReg
    Set oReg = CreateObject("WinReg.Registry")
   
    'Get DB connection data
    sConnection = oReg.GetRegValue(WinReg.HKEY_LOCAL_MACHINE, "\Software\Wow6432Node\MyApp\MySubApp", "DB Connection")

Again, originally it was not looking in ..\Software\Wow6432Node...   I changed this, updated registry, works like a charm in VS6. Then when running as an exec it returns nothing for the registry key being read which makes the subsequent file transfer fail.


Installer is:  Windows Installer. V 5.0.7601.17514
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

66chawgerAuthor Commented:
In addition to my previous comment, I hardcoded the registry value entry in the program, and it worked fine as an executable.  So Win7 64bit does not like something about the get registry entry code I listed previously, although, again, it works fine inside Visual Studio 6.  This is a work around, but I really need to figure out why Win 7 64bit is barfing when running this VB6 code as an executable or installed.
Duy PhamFreelance IT ConsultantCommented:
I doubt the problem could be related to the way you access Registry using COM Object (WinReg.Registry). It might require your installed application to run as Administrator to use that COM Object.

If your application only reads the Registry (no creating/writing), then I would suggest using native Win32 API for manipulating Registry: https://support.microsoft.com/en-us/kb/145679. With only Read access, it can work with standard users just fine.
Jacques Bourgeois (James Burger)PresidentCommented:
Do you run Visual Studio 6 on the Windows 7 computer?

Microsoft supports applications created with VB6 (although many 3rd party do not work well starting in Vista), but does not support the VB6 IDE on Windows 7, thus the compiler.

I would try compiling the application on a previous version of Windows instead of Windows 7.
66chawgerAuthor Commented:
I decided to bag the registry lookup and go with a manifest.   INI file worked also.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
66chawgerAuthor Commented:
The inherent issues with MS and backward compatibility between 32 and 64 bit Windows 7 operating system is just not worth the effort in regards to registry retrieval, in this case withing VB6.  There are just better alternatives to this issue, in my case I chose to use a manifest.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.