COM interop problem on 64bit OS

  • Thread starter Thread starter Yoavo
  • Start date Start date
Y

Yoavo

Hi,

I have a C# application built as AnyCPU which calls a 32 bit c++ application
(via COM interops).
When the c# application run on a 32 bit OS there is no problem.
But when I run it on 64 bit OS, the application failed to load the 32 bit
c++ application (I guess it is because it can't access the Wow6432Node in
Registry).

Is there a way to overcome this problem ?

thanks,
Yoav.
 
Hi,

I have a C# application built as AnyCPU which calls a 32 bit c++
application (via COM interops).
When the c# application run on a 32 bit OS there is no problem.
But when I run it on 64 bit OS, the application failed to load the 32 bit
c++ application (I guess it is because it can't access the Wow6432Node in
Registry).

Is there a way to overcome this problem ?

Try compiling for X86, that should work.
 
Hi,

I have a C# application built as AnyCPU which calls a 32 bit c++
application (via COM interops).
When the c# application run on a 32 bit OS there is no problem.
But when I run it on 64 bit OS, the application failed to load the 32 bit
c++ application (I guess it is because it can't access the Wow6432Node in
Registry).

Is there a way to overcome this problem ?

Try compiling for X86, that should work.
 
I know that, but my application should run as 64 bit application also.
This is why I build it with AnyCPU configuration.
 
I know that, but my application should run as 64 bit application also.
This is why I build it with AnyCPU configuration.
 
I know that, but my application should run as 64 bit application also.
This is why I build it with AnyCPU configuration.

A 32 bit app will run fine on a 64 bit OS. COM is from the 32 bit days, I
think you are attempting the impossible.
 
I know that, but my application should run as 64 bit application also.
This is why I build it with AnyCPU configuration.

A 32 bit app will run fine on a 64 bit OS. COM is from the 32 bit days, I
think you are attempting the impossible.
 
Yoavo said:
I know that, but my application should run as 64 bit application also.
This is why I build it with AnyCPU configuration.


Jeff Gaines said:
Try compiling for X86, that should work.

Your code must execute in 32 bit mode once you introduce a dependence on a
32 bit library. If running in 64 bit mode is a requirement, then you need to
find an alternative to your com utilities.

Mike
 
Yoavo said:
I know that, but my application should run as 64 bit application also.
This is why I build it with AnyCPU configuration.


Jeff Gaines said:
Try compiling for X86, that should work.

Your code must execute in 32 bit mode once you introduce a dependence on a
32 bit library. If running in 64 bit mode is a requirement, then you need to
find an alternative to your com utilities.

Mike
 
I know that, but my application should run as 64 bit application also.

Why? Do you actually have any specific requirements (i.e. memory)?

Keep in mind that it will otherwise happily run on 64-bit Windows, and
with .NET x64 installed (since that includes x86 version).

In general, a 64-bit process cannot execute any 32-bit code. The only
workaround is to split into two processes, and use IPC (such as named
pipes directly, or something higher-level such as .NET remoting) to
communicate. So your .NET app is still 64-bit, then you have a
separate small 32-bit process (could also be .NET) that loads the 32-
bit COM object, and exposes all its functionality via IPC.
 
I know that, but my application should run as 64 bit application also.

Why? Do you actually have any specific requirements (i.e. memory)?

Keep in mind that it will otherwise happily run on 64-bit Windows, and
with .NET x64 installed (since that includes x86 version).

In general, a 64-bit process cannot execute any 32-bit code. The only
workaround is to split into two processes, and use IPC (such as named
pipes directly, or something higher-level such as .NET remoting) to
communicate. So your .NET app is still 64-bit, then you have a
separate small 32-bit process (could also be .NET) that loads the 32-
bit COM object, and exposes all its functionality via IPC.
 
Jeff said:
A 32 bit app will run fine on a 64 bit OS. COM is from the 32 bit days,
I think you are attempting the impossible.

COM works just fine in 64 bit. In fact, many things in Windows could not
be accomplished without it. However, the OP needs to have a 64 bit
version of the COM component in question in order for his program to
work correctly, of which there might not be one.
 
Jeff said:
A 32 bit app will run fine on a 64 bit OS. COM is from the 32 bit days,
I think you are attempting the impossible.

COM works just fine in 64 bit. In fact, many things in Windows could not
be accomplished without it. However, the OP needs to have a 64 bit
version of the COM component in question in order for his program to
work correctly, of which there might not be one.
 
Back
Top