Skip to main content
GameDev.net gamedev.net
🔒 Locked

Easy question about GetCursorPos()

Started by Roof Top Pew Wee Oct 7, 2001 at 2:21 PM 1 replies 250+ views
Original Post
Roof Top Pew Wee
Roof Top Pew Wee
Here''s the code I''m having problems with. LPPOINT cursorPosition; GetCursorPos(cursorPosition); itoa(cursorPosition->x, holder1, 10); TextOut (hDC, 430, 450, holder1, strlen(holder1)); I''m doing this to print out the X position of the mouse cursor. Assuming that all of the rest of the variables (holder1, hDc, etc) are all valid and that I have locked so I can mess directly with the surface, why won''t it work. The problem is specifically on the itoa function. It gives me an error when I try to access the cursorPosition->x variable. I have put other varibles in there and the code works fine. I think the error is somewhere in how I''m using the GetCursorPos() function. Any ideas? Thanks. --Vic--
Null and Void
Null and Void
Change that to:
  
POINT cursorPosition;
GetCursorPos(&cursorPosition);
itoa(cursorPosition.x, holder1, 10);
TextOut(hDC, 430, 450, holder1, strlen(holder1));

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.