Windows7.1 SDK:C2373:"MonitorFromWindow"重新定义 [英] Windows7.1 SDK: C2373: "MonitorFromWindow" Redefinition

查看:113
本文介绍了Windows7.1 SDK:C2373:"MonitorFromWindow"重新定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于以下说明,给出了32位版本VS10 MCBS中的错误链接规范与先前的"MonitorFromWindow"不兼容":

The error "linkage specification is incompatible with previous "MonitorFromWindow"" in 32 bit build VS10 MCBS is given for the following decl:

 int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow)
{
    HMONITOR MonitorFromWindow(_In_ HWND  hwnd, _In_ DWORD dwFlags);

    return DialogBoxW(hInstance, MAKEINTRESOURCEW(lpTemplate), nullptr, DlgProc);
}

假设解决方案与给定的

Assumed the solution would be similar to the one given here, but here it might be some problem with the SDK although some kind of header hack is preferred.

推荐答案

该错误告诉您MonitorFromWindow的声明与先前的声明冲突. Winuser.h中的先前声明使用extern "C"链接声明了该函数,该函数为__declspec(dllimport),并具有__stdcall调用约定.

The error is telling you that your declaration of MonitorFromWindow conflicts with the prior declaration. The prior declaration in Winuser.h declared the function with extern "C" linkage, is __declspec(dllimport) and has the __stdcall calling convention.

您应该删除错误的声明,并从头文件中使用它.

You should remove your erroneous declaration and use that from the header file.

这篇关于Windows7.1 SDK:C2373:"MonitorFromWindow"重新定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆