I am trying to get this code to work but get an error message. This draws an X Y axis but I would also like to add some text
HDC hDC = GetDC(hwndDlg);
//draw x-axis
MoveToEx(hDC,0,240,NULL); //start of line x y
LineTo(hDC,240,240); //finish of line x y
//draw y-axis
MoveToEx(hDC,10,50,NULL); //start of line x y
LineTo(hDC,10,250); //finish of line x y
//origin
TextOut(hDC, 4,245,L"O",1);
It works fine until I add the last line TextOut(hDC, 4,245,L"O",1);
And here is the error message when I Build:
POLINK: error: Unresolved external symbol 'TextOutW'.
POLINK: fatal error: 1 unresolved external(s).
Can somebody please explain/suggest another way of writting text.
Thank you
Tony
Is Gdi32.lib included in the linker options ???
It wasn't so I added under "Library and object files:" was that correct?
It didn't make any difference as I still get the same error messages.
Sounds strange, also because the wingdi.h has the pragma to autoinclude the gdi32.lib.
Please post the project so we'll check.
Hi frankie
Hopefully you can see the attached project, I've shortened it a bit.
Thanks
Tony
Tony your project is for pocketPC, you have to know that the function TextOut doesn't exist for WinCE.
You have to use ExtTextOut. Change yor line:
TextOut(hDC,5,240,L"0",1);
With:
ExtTextOut(hDC, 5, 240, 0, NULL, L"0", 1, NULL);
And it should work.
P.S. for everybody: please specify if your code is for PC or Pocket, and possibly post in the correct thread for pocketPC.
frankie
Thank you that works.
Sorry if I posted in the wrong section but I'm still a beginner, probably three weeks playing with C.
All my code so far has been written for ppc and this is one of a few differences.
Thanks again.
Tony