32Bit Service working in Windows 7 64 Bit

Wayne Michael
Wayne Michael used Ask the Experts™
on
I have a service application written in VS2005 VB.NET.

The application uses a COM object that is written in VB6.

The application works fine on most machines and was working fine on this machine until recently.

The machine is a windows 7 64Bit machine.

The application will run just fine until it initialized the COM object, it claims it can not find it.

I read that to use 32bit COM objects you have to run as a 32 Bit application.

I recompiled the service as a 32Bit application and it will not start on the windows 7 64 Bit machine.  

I do not want to rewrite the windows COM object as a .Net class.  It would be very complex to do so.

any ideas?

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
This is possible with this registry edit
go to Start, Select Run, Enter Regedit and click return
¦Locate your COM object GUID under the HKey_Classes_Root\Wow6432Node\CLSID\[GUID]
¦Once located add a new REG_SZ (string) Value. Name should be AppID and data should be the same COM object GUID you have just searched for
¦Add a new key under HKey_Classes_Root\Wow6432Node\AppID\
The new key should be called the same as the com object GUID
¦Under the new key you just added, add a new REG_SZ (string) Value, and call it DllSurrogate. Leave the value empty
¦Create a new Key under HKey_Local_Machine\Software\Classes\AppID\
Again the new key should be called the same as the COM object’s GUID. No values are necessary to be added under this key.

That’s it, your COM Object should now be accessible from a 64bit environment and can be used like a regular COM Object.
Wayne MichaelSenior Software Developer

Author

Commented:
I will attempt this in the morning and see if it works.
Wayne MichaelSenior Software Developer

Author

Commented:
Thanks!
Wayne MichaelSenior Software Developer

Author

Commented:
Any way to automate this with say a "regsvr64.exe" type command?  

I have to redistribute the application.

I suppose on start-up I can see if I am on 64 bit and if so add the info if it is missing from the registry.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial