Thread overview
Error compiling HDC
Dec 25, 2003
Scrappy
Dec 25, 2003
Jan Knepper
Dec 28, 2003
Scrappy
December 25, 2003
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
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
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