473,405 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

simple question on WM_PAINT

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 !!!

Dec 30 '05 #1
2 3682
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

Dec 30 '05 #2
"black(flashing vampire)" <qu********@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
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.  return 0;
  23.  }
  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 !!!


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

Jan 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Dan | last post by:
Using XML::Simple in perl is extreemly slow to parse big XML files (can be up to 250M, taking ~1h). How can I increase my performance / reduce my memory usage? Is SAX the way forward?
4
by: Kevin Dombroski | last post by:
Howdy - I would like my application to be able to read data from another application. Specifically, I would like my to get the text from the "client area" of another application's window whenever...
7
by: abcd | last post by:
I am trying to set up client machine and investigatging which .net components are missing to run aspx page. I have a simple aspx page which just has "hello world" printed.... When I request...
0
by: --== Alain ==-- | last post by:
Hi, i was thinkging to override WNDPROC of my ListView control, in order to control how the headers and items will be redrawn. My purpose is to : - keep the header format (horizontal and...
14
by: Giancarlo Berenz | last post by:
Hi: Recently i write this code: class Simple { private: int value; public: int GiveMeARandom(void);
2
by: =?Utf-8?B?RXJpYw==?= | last post by:
Hello All, I am currently working on an issue that has a custom control that mimics a combobox that when it has focus it continues to generate endless WM_PAINT Messages. The control in itself...
2
by: kiberg | last post by:
Hi When I listen WM_PAINT event, the cpu is max. LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { int x, y; HDC hdc; HPEN hOldPen, hPen; HBRUSH...
3
by: ayan4u | last post by:
hi, I am using InvalidataRect(hWnd, &rect, TRUE) to clear my client rect....does this mean that a WM_PAINT message will the invoked automatically by it.... neways fot the time being lets assume...
10
by: Phillip Taylor | last post by:
Hi guys, I'm looking to develop a simple web service in VB.NET but I'm having some trivial issues. In Visual Studio I create a web services project and change the asmx.vb file to this: Imports...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.