两个库的头文件,同方法名(API名同)如何处理?

kingmax54212008 kingmax54212008 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
两个库的头文件,同方法名(API名同)如何处理?
我的CPP程序,引用了,两个头文件,debugapi.h (来自WDK8.0 -windows驱动开发SDK) , WinBase.h (Windows库)。这两个头文件库里, 有同名方法: OutputDebugString

我调试的时候,会调用 OutputDebugString

但事实上 这个两个头文件下都有这个函数。 我函数要调用, WinBase.h的 OutputDebugString, 但实际执行或go to definition 会都指向debugapi.h下的OutputDebugString。

求大虾指教!!!


以下复制了写,标准头文件里的一些定义说明。
/******************  debugapi.h 下的定义**************************/
WINBASEAPI
VOID
WINAPI
OutputDebugStringW(
_In_opt_ LPCWSTR lpOutputString
);

#ifdef UNICODE
#define OutputDebugString OutputDebugStringW
#else
#define OutputDebugString OutputDebugStringA
#endif // !UNICODE



/****************** WinBase.h下的定义**************************/

WINBASEAPI
VOID
WINAPI
OutputDebugStringA(
_In_opt_ LPCSTR lpOutputString
);

WINBASEAPI
VOID
WINAPI
OutputDebugStringW(
_In_opt_ LPCWSTR lpOutputString
);

#ifdef UNICODE
#define OutputDebugString OutputDebugStringW
#else
#define OutputDebugString OutputDebugStringA
#endif // !UNICODE



//////////////////////////////////////////////////////////////////////////////////////////////////////



...全文

相关推荐

评论 8
收藏 已收藏
分享
返回顶部
kingmax54212008
进程/线程/DLL 15,466 成员 49,169 内容