Richard Odenweller
10/19/2007 8:35:00 PM
Hi all,
I've got an interop problem I hope you can help me solve. I have an
out-of-proc 32-bit exe COM server that I want to access from a C# assembly.
The method I want to call has an HWND parameter. The C# assembly may be
either 32/64 bit depending on the platform. Referencing the type library of
the exe server returns a _RemoteableHandle argument for the HWND parameter.
I know I should be able to pass an HWND since that value will always be able
to be represented in a 32bit variable. What I don't know is how to initialize
the _RemoteableHandle stucture so that the HWND is correctly marshalled from
the 64 bit proc to the 32bit proc.
All the references I have seen to this situation suggest that the typelib be
modified so that an int is emitted instead of a RemoteableHandle. However
they have all been in-proc examples where there is no real concern about
marshalling. Does anyone have any experience with this?
Thanks
--
Richard