views:

81

answers:

1

I have a .NET windows forms application compiled as x86 – it needs to be compiled as x86 because it references 3rd party DLLs which are 32 bit. The application uses COM interop to automate Office applications and also AutoCAD. My question is: will my COM interop code work okay on a 64 bit operating system against the 64 bit versions of Office and AutoCAD? I’m going to try this out but I wondered whether someone knew of any problems?

+1  A: 

If the office and autocad are purely 64bit then probably not because they will be 64bit images and therefore not load into a 32bit process and you have the reverse problem for your 32bit ones.

We had a similar situation and ended up making our program "anycpu" and provided another little program that was 32bit to talk to the 32bit dll's then when we detect (intptr.size = 4[32] or 8[64]) if we are on a 64bit machine, then we invoke the 32bit program (to perform the communication to these 3rd party dll's) and generate some kind of output (in our case we wrote a small XML file) and then exit. We waited for the program to exit and then read the file and took action on the responses.

It really just comes down to which side of the program has the most 64/32 and code according to that.

Paul Farry