Calling Convention question

  • Thread starter Thread starter Ross Cooper
  • Start date Start date
R

Ross Cooper

Hi all, you know how with DllImportAttribute you can specify a calling
convention, can you specify one for a COM interface as well? Im trying to
talk to some COM objects and it turns out they were compiled CDECL instead
of STDCALL.

As theyre all 3rd party I cant recompile them properly. My temporary
solution has been to write an ATL COM object that I can talk to from C#, and
then it talks to the other COM objects using the CDECL calling convention,
but I'd much rather use C# for everything instead of having to hack a bit of
C++ in there too :)

Thanks,
Ross
 
Dear Lord! Don't tell me it's a 16-bit COM component?!
32-bit COM components shouldn't have methods that are anything but STDCALL
:-)

-Rob Teixeira [MVP]
 
Back
Top