simple question on WM_PAINT

  • Thread starter black(flashing vampire)
  • Start date
B

black(flashing vampire)

hi all~

i just built a cute window with the help of a tutorial, but met some
problem when try to repaint the window, my callback function is as
below:
Code:
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM
lParam)
{
	switch (iMsg)
	{
		case WM_PAINT:
			PAINTSTRUCT ps;
			HDC hdc;
			hdc = BeginPaint(hwnd, &ps);
			TextOut(hdc, 100, 100, "Holla !", 10);
			EndPaint(hwnd, &ps);
			break;
		case WM_DESTROY:
			PostQuitMessage(0);
			break;
		case WM_CLOSE:
			DestroyWindow(hwnd);
			break;
		default:
			return DefWindowProc(hwnd, iMsg, wParam, lParam);
	}

	return 0;
}
when i compile the program it reports an error like this:
[Linker error] undefined reference to `TextOutA@20'
i'm with Dev-C++, anyone help me ? tks !!!
 
L

Luke Meyers

Try posting your query to a more appropriate forum -- i.e. one devoted
to windows programming.

If I had to guess, I'd say you're missing a statically-linked library
on your include path.

Luke
 
J

Jim Langston

black(flashing vampire) said:
hi all~

i just built a cute window with the help of a tutorial, but met some
problem when try to repaint the window, my callback function is as
below:
Code:
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM
lParam)
{
switch (iMsg)
{
case WM_PAINT:
PAINTSTRUCT ps;
HDC hdc;
hdc = BeginPaint(hwnd, &ps);
TextOut(hdc, 100, 100, "Holla !", 10);
EndPaint(hwnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_CLOSE:
DestroyWindow(hwnd);
break;
default:
return DefWindowProc(hwnd, iMsg, wParam, lParam);
}

return 0;
}
when i compile the program it reports an error like this:
[Linker error] undefined reference to `TextOutA@20'
i'm with Dev-C++, anyone help me ? tks !!!

try microsoft.public.vc.language Just don't tell them you're using Dev c++
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top