CSharp with COM components in 64bit

Y

Yoavo

Hi,
I have a c# application which uses COM DLLs which were build in 32bit
environment.
When I tried to run my program in 64 bit computer, the program crashed when
trying to create a COM class.

can someone please help ?

Yoav.
 
W

Willy Denoyette [MVP]

Yoavo said:
Hi,
I have a c# application which uses COM DLLs which were build in 32bit environment.
When I tried to run my program in 64 bit computer, the program crashed when trying to
create a COM class.

can someone please help ?

Yoav.

You can't mix 64 bit and 32 bit code in user applications, so you'll have to compile your
application as 32 bit, to do this:
set the platform to x86 in your project properties or add /platform:x86 as command line
switch.
Willy.
 
L

Laura T.

Unless you can convert the existing component to out-of-process COM server
(what we are doing for short term migration). In that case the 32-bit/64-bit
interoperability works. It is even quite fast.
 
W

Willy Denoyette [MVP]

Laura T. said:
Unless you can convert the existing component to out-of-process COM server (what we are
doing for short term migration). In that case the 32-bit/64-bit interoperability works. It
is even quite fast.
Even if you can convert, you'll have to keep in mind that It's 100 times slower to marshal
cross-process than calling in process same thread.
Also, if you don't need the extended addressing capabilities of 64 it's actually better to
compile for X86 anyway.

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top