Running a 32-bit application using a 32-bit computer on a 64-bit Windows machine

I have a C # application using a C ++ COM object that is built on a 32 bit machine. Now I have to run them on a 64-bit machine. I registered a COM object. The corresponding entry was created in the register under the control of the computer \ hkey_classes_root \ wow6432node \ clsid {xxx}. However, when I try to start the application, he says that: "Retrieving the factory COM class for the component with CLSID {xxx} failed due to the following error: 80040154.". As I understand it, an error code means that the class is not registered. Please help !!! Thanks

+3
source share
4 answers

The first answer above is the correct answer. You cannot run the CPU ANY target application on 64-bit Windows if you are referencing a 32-bit COM component. It will not load.

What happens is that JIT sees the processor ANY and promotes your application up to 64 bits. But there is no 64-bit version of com control, and therefore you get an unregistered error.

This is a big problem for people who use Microsoft Access for their database. There is no 64-bit version of Access, so when they see an error, they believe that they need a 64-bit runtime (does not exist). You should specify your application as 32-bit just to use Access runtime.

(IMHO) - 64- 100% .

32 , .

+4

# Any CPU, 64- x64. 64- 32- .

Visual Studio 32- . " ", "", "". x86.

32- , .

+2

.NET 64-, 32- COM- .

, COM- Automation . COM + ( - > - > ) . , , 64- .

+2

, 32- 64- . 64- (, WOW64 ). ( 64- ) DLL, 64- DLL.

:

http://searchwindowsserver.techtarget.com/tip/0,289483,sid68_gci1220022,00.html

Edit:

If you go to "Project Properties" → "Build", change the target object of the platform "Any processor" to X86. See if this helps.

Or you need to register your DLLs: http://riteshk.blogspot.com/2007/05/retrieving-com-class-factory-failed-due.html

0
source

Source: https://habr.com/ru/post/1710100/


All Articles