Skip to main content
gamedev.net
🔒 Locked

Win32 Randomness

Started by Ax Nov 9, 2002 at 6:19 PM 1 replies 200+ views
Original Post
Ax
Ax
I stepped away from the Win32 API for awhile, came back, and...memory lapse! Anyway, I'm having troubles with window's GetDlgItemInt/SetDlgItemInt functions; how do I go from a pointer to int to an int? Ex.:
int* variable;

...
GetDlgItemInt(dlg_hwnd, DLG_TEXTBOX, variable, TRUE);
...
//miles down the code
SetDlgItemInt(dlg_hwnd, DLG2_TEXTBOX, variable, TRUE);
...
 
Okay, the second is where the error occurs -- obviously. So, how do I go from the pointer obtained via the GetDlgItemInt to a regular int so I can pass it through the SetDlgItemInt function. Thanks, Ax [edited by - Ax on November 9, 2002 7:20:58 PM]
-Ax
Evil Bill
Evil Bill
If you want to pass a pointer to SetDlgItemInt, you need to be sure that the variable pointed to isn''t local - i.e. you need to allocate it with new.

HTH, Steve

Steve
Check my Web Server!
Member of the Unban Mindwipe Society (UMWS)

Topic Locked

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

Sign in to reply to this topic.