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

Dialog creation data

Started by Daedalus711 Aug 26, 2006 at 10:24 AM 1 replies 400+ views
Original Post
Daedalus711
Daedalus711
I've got a pointer to structure containing some app data that I want displayed in the dialog box, and I'm using DialogBoxParam (...) to set it as the creation data. During WM_INITDIALOG when I'm retreiving it with data = (DATASTRUCT*) ((CREATESTRUCT*) lParam)->lpCreateParams; The memory address changes from its initial address to 0x00000001. This wreaks havoc with my strings inside the structure. Nothing like this happens when I do the same thing with a normal window. Why is it changing?
mattd
mattd
The lParam in WM_INITDIALOG is the user data itself.
So you can just use:
data = (DATASTRUCT *)lParam;

Reference
Daedalus711
Daedalus711
Ahhhhhhh...excellent. Thank you.

Topic Locked

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

Sign in to reply to this topic.