User Data

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • I am using local user data to hold information pertaining to a dialog instance. When is it appropriate to initialize the data? It appears as if calling SetUserData as a part of WM_INIT is premature. When is it appropriate?
  • I have learned that if you do it during a WM_INIT override, it isn't retained. In other words, if you try to set data, and then use the <WIDGET>_SetUserData function(), the data isn't retained at the next WM_PAINT (for example). However, I have impirically learned that if you set the data after running WM_DefaultProc(pMsg) within the WM_INIT override, everything works. I'm not sure this is the best form, but it appears to get the job done!