joezhou
March 19th, 2003, 06:42 PM
I wrote a program use the pure sdk, but when I build the project, vc++ says, "warning C4013: 'SetDCBrushColor' undefined; assuming extern returning int", and when linked, there meets an "unresolved external symbol _SetDCBrushColor". I have checked the msdn, it says this funcion declare in wingdi.h, include windows.h, and link with gdi32.lib, all this files and included and the lib path is there(you know, just the default), what's the problem, so strange!
ovidiucucu
March 20th, 2003, 01:57 AM
This function requires Windows 2000.
It is not supported on 95/98/NT.
Add the following before all your includes.
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0500
joezhou
March 20th, 2003, 02:00 AM
My OS is windows2000 professional!!!!
ovidiucucu
March 20th, 2003, 02:23 AM
Or try the following:
typedef COLORREF (WINAPI* lpfnSetDCBrushColor)
( HDC hdc, COLORREF crColor );
// ..............
HMODULE hGdi32 = LoadLibrary( "gdi32.dll" );
if( NULL == hGdi32 )
{
// ... report library error ...
return;
}
lpfnSetDCBrushColor lpfn = NULL;
lpfn = (lpfnSetDCBrushColor)
GetProcAddress( hGdi32, "SetDCBrushColor" );
if( NULL == lpfn )
{
// ... report function not found ...
return;
}
COLORREF crOld = lpfn( hdc, RGB(0,0,255) );
// ..............