views:

33

answers:

1

Hello,

how can I get calling convention at run time using type library ? whether stdcall,cdecl or winapi or any other?

Regards Usman

A: 

If a typelibrary is involved, you're using COM. COM always uses the same calling convention (on a given OS), so it isn't encoded into the type library. In the headers it shows up as STDMETHOD (or something like that -- I'm too lazy to check the exact spelling at the moment), but if memory serves it's basically equivalent to __cdecl. If memory serves, there's also an _STDMETHOD (or, again, something similar) that lets you specify a return type other than HRESULT.

Jerry Coffin
It's __stdcall. They're not the same thing.
DeadMG