afx

MFC: _AFXWIN_INLINE give me “no overloaded function takes 6 arguments”

心不动则不痛 提交于 2020-12-16 07:01:44
问题 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 ); I get this error: Error C2661 'CWnd::MoveWindow': no overloaded function takes 6 arguments G:\proj\repos\EnterDG

windows.h and MFC

不羁的心 提交于 2019-12-18 16:26:11
问题 Why can't I include windows.h in afx(MFC) projects? 回答1: Typically, MFC application code includes afx.h or afxwin.h (the latter includes former). First two lines of windows.h are #ifndef _WINDOWS_ #define _WINDOWS_ which means that _WINDOWS_ becomes defined if this header is included. Afx.h includes afxver_.h and this header includes afxv_w32.h which contains following code: #ifdef _WINDOWS_ #error WINDOWS.H already included. MFC apps must not #include <windows.h> #endif ... #include <windows