Connecting Tech Pros Worldwide Forums | Help | Site Map

simple question on WM_PAINT

black(flashing vampire)
Guest
 
Posts: n/a
#1: Dec 30 '05
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:
Expand|Select|Wrap|Line Numbers
  1. LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM
  2. lParam)
  3. {
  4. switch (iMsg)
  5. {
  6. case WM_PAINT:
  7. PAINTSTRUCT ps;
  8. HDC hdc;
  9. hdc = BeginPaint(hwnd, &ps);
  10. TextOut(hdc, 100, 100, "Holla !", 10);
  11. EndPaint(hwnd, &ps);
  12. break;
  13. case WM_DESTROY:
  14. PostQuitMessage(0);
  15. break;
  16. case WM_CLOSE:
  17. DestroyWindow(hwnd);
  18. break;
  19. default:
  20. return DefWindowProc(hwnd, iMsg, wParam, lParam);
  21. }
  22.  
  23. return 0;
  24. }
  25.  
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 !!!


Luke Meyers
Guest
 
Posts: n/a
#2: Dec 30 '05

re: simple question on WM_PAINT


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

Jim Langston
Guest
 
Posts: n/a
#3: Jan 2 '06

re: simple question on WM_PAINT


"black(flashing vampire)" <quiteblack@gmail.com> wrote in message
news:1135911315.918365.86150@g44g2000cwa.googlegro ups.com...[color=blue]
> 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:
>
Expand|Select|Wrap|Line Numbers
  1. > LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM
  2. > lParam)
  3. > {
  4. > switch (iMsg)
  5. > {
  6. > case WM_PAINT:
  7. > PAINTSTRUCT ps;
  8. > HDC hdc;
  9. > hdc = BeginPaint(hwnd, &ps);
  10. > TextOut(hdc, 100, 100, "Holla !", 10);
  11. > EndPaint(hwnd, &ps);
  12. > break;
  13. > case WM_DESTROY:
  14. > PostQuitMessage(0);
  15. > break;
  16. > case WM_CLOSE:
  17. > DestroyWindow(hwnd);
  18. > break;
  19. > default:
  20. > return DefWindowProc(hwnd, iMsg, wParam, lParam);
  21. > }
  22. >
  23. > return 0;
  24. > }
> 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 !!![/color]

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



Closed Thread