Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
无论是使用 stdcall、cdecl、winapi 还是其他任何类型的库,如何在运行时获取调用约定?
如果涉及类型库,则您使用的是 COM。COM 总是使用相同的调用约定(在给定的操作系统上),因此它没有被编码到类型库中。在标题中它显示为STDMETHOD(或类似的东西——我现在懒得检查确切的拼写),但如果有记忆,它基本上相当于__cdecl. 如果没记错的话,还有一个_STDMETHOD(或者类似的东西)可以让您指定除HRESULT.
STDMETHOD
__cdecl
_STDMETHOD
HRESULT