Thread overview | |||||
---|---|---|---|---|---|
|
December 25, 2003 Error compiling HDC | ||||
---|---|---|---|---|
| ||||
in a standard WinApi programme with windows.h as the only header file, if I put: case WM_PAINT: HDC hDC; PAINTSTRUCT Ps; hDC = BeginPaint(hwnd, &Ps); TextOut(hDC, 50, 42, "Blah Blah Blah", 13); EndPaint(hwnd, &Ps); break; for one the the WndProc cases for the msg argument, when I try to compile I get this: Error 42: Symbol Undefined _TextOutA@20 If I remove the TextOut line it compiles (but does nothing ofc). It also screws up with SetBkColor and the same error. Any suggestions? Thanks in advance. |
December 25, 2003 Re: Error compiling HDC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Scrappy | Add GDI32.LIB to your program's link phase. Also... You might want to use DrawText instead of TexOut. HTH Scrappy wrote: > in a standard WinApi programme with windows.h as the only header file, if I put: > > case WM_PAINT: > HDC hDC; > PAINTSTRUCT Ps; > hDC = BeginPaint(hwnd, &Ps); > TextOut(hDC, 50, 42, "Blah Blah Blah", 13); > EndPaint(hwnd, &Ps); > break; > > for one the the WndProc cases for the msg argument, when I try to compile I get > this: Error 42: Symbol Undefined _TextOutA@20 > If I remove the TextOut line it compiles (but does nothing ofc). It also screws > up with SetBkColor and the same error. Any suggestions? Thanks in advance. > > -- ManiaC++ Jan Knepper |
December 28, 2003 Re: Error compiling HDC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jan Knepper | Thanks loads! I just put #pragma comment(lib, "gdi32.lib") in with my includes and it all works great now! > >Add GDI32.LIB to your program's link phase. >Also... You might want to use DrawText instead of TexOut. > >HTH |
Copyright © 1999-2021 by the D Language Foundation