0

我对 afxv_32.h 有疑问。VS 2012 找不到 AFX_INLINE 和 HTASK。指定“Win32 为此使用带有参数的宏,这会破坏 C++ 代码”。显然 AFX_INLINE 是一个宏。我已经找了很长时间了,但我没有找到。你知道如何处理这个吗?

    // Win32 uses macros with parameters for this, which breaks C++ code.
    #ifdef GetWindowTask
    #undef GetWindowTask
    AFX_INLINE HTASK GetWindowTask(HWND hWnd)
        { return (HTASK)(DWORD_PTR)::GetWindowThreadProcessId(hWnd, NULL); }
    #endif

    // Win32 uses macros with parameters for this, which breaks C++ code.
    #ifdef GetNextWindow
    #undef GetNextWindow
    AFX_INLINE HWND GetNextWindow(HWND hWnd, UINT nDirection)
        { return ::GetWindow(hWnd, nDirection); }
    #endif

    // Avoid mapping CToolBar::DrawState to DrawState[A/W]
    #ifdef DrawState
    #undef DrawState
    AFX_INLINE BOOL WINAPI DrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC lpOutputFunc,
        LPARAM lData, WPARAM wData, int x, int y, int cx, int cy, UINT fuFlags)
    #ifdef UNICODE
        { return ::DrawStateW(hdc, hbr, lpOutputFunc, lData, wData, x, y, cx, cy,
            fuFlags); }
    #else
        { return ::DrawStateA(hdc, hbr, lpOutputFunc, lData, wData, x, y, cx, cy,
            fuFlags); }
    #endif
    #endif

    // Avoid mapping CStatusBar::DrawStatusText to DrawStatusText[A/W]
    #ifdef DrawStatusText
    #undef DrawStatusText
    AFX_INLINE void WINAPI AfxDrawStatusTextA(HDC hDC, LPRECT lprc, LPCTSTR szText,
        UINT uFlags);
    AFX_INLINE void WINAPI AfxDrawStatusTextW(HDC hDC, LPRECT lprc, LPCTSTR szText,
        UINT uFlags);
    AFX_INLINE void WINAPI DrawStatusText(HDC hDC, LPRECT lprc, LPCTSTR szText,
        UINT uFlags) 
    #ifdef UNICODE
        { ::AfxDrawStatusTextW(hDC, lprc, szText, uFlags); }
    #else
        { ::AfxDrawStatusTextA(hDC, lprc, szText, uFlags); }
    #endif
    #endif

    // FreeResource is not required on Win32 platforms
    #undef FreeResource
    AFX_INLINE BOOL WINAPI FreeResource(_In_ HGLOBAL) { return TRUE; }
    // UnlockResource is not required on Win32 platforms
    #undef UnlockResource
    AFX_INLINE int WINAPI UnlockResource(HGLOBAL) { return 0; }
4

1 回答 1

0

您将在afxisapi.h.

于 2013-10-10T09:20:14.927 回答