简体   繁体   English

从* .lib c ++调用

[英]calling from a *.lib c++

Could someone please tell me how to call this type of function from a lib file (I got this from dumpbin /list ) here it is: 00A 00000000 SECT4 notype External | ?GetWindowPauseOnSizeMove_ext@@3P6G_NXZA (bool (__stdcall* GetWindowPauseOnSizeMove_ext)(void)) 有人可以告诉我如何从lib文件(我从dumpbin /list获得此函数)中调用这种类型的函数: 00A 00000000 SECT4 notype External | ?GetWindowPauseOnSizeMove_ext@@3P6G_NXZA (bool (__stdcall* GetWindowPauseOnSizeMove_ext)(void)) 00A 00000000 SECT4 notype External | ?GetWindowPauseOnSizeMove_ext@@3P6G_NXZA (bool (__stdcall* GetWindowPauseOnSizeMove_ext)(void))

I've tried 我试过了

#pragma comment( lib, "MyLib" )
 extern "C" bool _stdcall GetWindowPauseOnSizeMove_ext(void)

But I Get this error 但是我得到这个错误

 Severity Code Description Project File Line Suppression State 

Error LNK2019 unresolved external symbol _GetWindowPauseOnSizeMove_ext@0 referenced in function _Test NF_dll D:\\Test\\Test\\main.obj 1 错误LNK2019无法解析的外部符号_GetWindowPauseOnSizeMove_ext @ 0在函数_Test NF_dll D:\\ Test \\ Test \\ main.obj 1中引用

Any help will be great 任何帮助都会很棒

According to the parameter mangling in the dumpbin list, it appears that the function has been actually compiled as C++. 根据dumpbin列表中的参数处理,似乎该函数实际上已编译为C ++。

Try to remove the extern "C" , and try to play with the calling convention ( __stdcall , _cdecl , __fastcall ). 尝试删除extern "C"并尝试使用调用约定( __stdcall_cdecl__fastcall )。


If the http://demangler.com/ is correct, the function signature should be: 如果http://demangler.com/是正确的,则函数签名应为:

BOOL __stdcall GetWindowPauseOnSizeMove_ext(void)

Ie close to what you have, only with the C++ linkage instead of the C linkage. 即接近您所拥有的,仅使用C ++链接而不是C链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM