学windows sdk,程序中
SelectObject(hDC,GetStockObject(DC_BRUSH));
SetDCBrushColor(hDC,0x0) 
为何总提示
SetDCBrushColor' : undeclared identifier

解决方案 »

  1.   

    #define _WIN32_WINNT 0x0501
    添加到你#include <windows.h>的前面
    如果是mfc工程 添加到#include <afxwin.h>的前面
    先救火了
      

  2.   

    你查一下就可以知道 这个函数只能在win2000以及更高版本的windows中被支持
    所以platform sdk采用了这样一种方法 你必须在程序中显示定义一个宏来告诉platform sdk程序运行的windows版本 这样就可以使用那些必须要求win2000以上才可以使用的宏定义和函数了
    刚才那个其实 #define _WIN32_WINNT 0x0500就可以(表示win2000)
    再添一句 你可以在wingdi.h中看到这样的定义
    #if (_WIN32_WINNT >= 0x0500)
    #define DC_BRUSH            18
    #define DC_PEN              19
    #endif#if (_WIN32_WINNT >= 0x0500)
    WINGDIAPI COLORREF WINAPI SetDCBrushColor(HDC, COLORREF);
    WINGDIAPI COLORREF WINAPI SetDCPenColor(HDC, COLORREF);
    #endif这样你就应该清楚了
      

  3.   

    Windows NT/2000/XP: Included in Windows 2000 and later.
      
    Windows 95/98/Me: Unsupported.-----------------------------
      
    Header: Declared in Wingdi.h; include Windows.h.
    Library: Use Gdi32.lib.
      

  4.   

    对不起flyidd兄弟了 我说的话没有根据
    道歉!!
    :)