MFC:_AFXWIN_INLINE 给我“没有重载函数需要 6 个参数"; [英] MFC: _AFXWIN_INLINE give me "no overloaded function takes 6 arguments"
问题描述
在 MFC 应用程序中,我试图移动我为调试目的添加的控制台窗口.
In an MFC application I am trying to move a console window I have added for debug purposes.
/* Put here just for reference
_AFXWIN_INLINE void CWnd::MoveWindow(LPCRECT lpRect, BOOL bRepaint)
{ MoveWindow(lpRect->left, lpRect->top, lpRect->right - lpRect->left,
lpRect->bottom - lpRect->top, bRepaint); }
*/
HANDLE hh;
bool oo = CWnd::MoveWindow( hh, 100, 0, 300, 300, true );
我收到此错误:
Error C2661 'CWnd::MoveWindow': no overloaded function takes 6 arguments
G:\proj\repos\EnterDG\EnterDGDlg.cpp 201
奇怪的是,如果我将鼠标指针放在MoveWindow"上,我得到了预期的原型.但是如果我使用转到定义"我得到了你在第一行看到的定义(变灰).
The strange thing is that if I put the mouse pointer at the "MoveWindow"" I get the expected prototype. But if I use "goto definition" I get the definition you see in the first lines( greyed out ).
我曾尝试#undef _AFXWIN_INLINE"
I have tried to "#undef _AFXWIN_INLINE"
推荐答案
CWnd::MoveWindow 有两个重载,一个有 5 个参数,另一个有 2 个参数.正如错误所指出的,没有需要 6 个参数的重载.
CWnd::MoveWindow has two overloads, one taking 5 arguments, the other taking 2 arguments. As the error indicates, there is no overload that takes 6 arguments.
您似乎正在尝试调用 Windows API 函数 MoveWindow 代替.这是一个免费函数,因此您需要删除 CWnd::
范围解析.使用全局命名空间解析前缀总是安全的,例如:::MoveWindow(...);
.
It looks like you are trying to call the Windows API function MoveWindow instead. This is a free function, so you need to drop the CWnd::
scope resolution. Using a global namespace resolution prefix is always safe, e.g.: ::MoveWindow(...);
.
这篇关于MFC:_AFXWIN_INLINE 给我“没有重载函数需要 6 个参数";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!