home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / mswindo / programm / misc / 3325 < prev    next >
Encoding:
Text File  |  1992-11-09  |  1.6 KB  |  51 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!utcsri!torn!newshub.ccs.yorku.ca!ists!carty
  3. From: carty@ists.ists.ca (Ed Carty)
  4. Subject: Dialog instance data...
  5. Message-ID: <1992Nov9.161604.2770@ists.ists.ca>
  6. Organization: Institute for Space and Terrestrial Science
  7. Distribution: na
  8. Date: Mon, 9 Nov 92 16:16:04 GMT
  9. Lines: 40
  10.  
  11.  
  12. 9 Nov. 1992
  13.  
  14. Anyone walked this road before...
  15.  
  16. I'd like to encapsulate instance data with a modeless dialog.  I'm creating
  17. the dialog with CreateDialogParam(), passing initialization data via the
  18. lParam.
  19.  
  20. I'm using the standard 'message-cracker' dialog methods, modified as per the
  21. standard 'message-cracker' window methods, allocating an instance data
  22. structure on creation, which I'd like to attach to each instance of the 
  23. dialog window.
  24.  
  25. In <windows.h> there are several interesting things;
  26.  
  27. /* cbWndExtra bytes needed by dialog manager for dialog classes */
  28. #define DLGWINDOWEXTRA  30
  29.  
  30. /* Get/SetWindowWord/Long offsets for use with WC_DIALOG windows */
  31. #define DWL_MSGRESULT   0
  32. #define DWL_DLGPROC     4
  33. #define DWL_USER        8
  34.  
  35. It seems that the dialog window procedure get 30 extra bytes, with offsets
  36. for the return long, the dialog procedure and something called DWL_USER.  I
  37. assumed that I could use DWL_USER to attach the pointer to my instance data
  38. structure, but this causes 'GDI: HFONT not deleted' warnings.  It seems
  39. like windows is using this location...
  40.  
  41. I ain't got the guts to muck around with the remaining 18 of the 30 extra
  42. bytes.  Also, we're writing a commercial app., and can't risk 'undocumented
  43. windows' tricks.
  44.  
  45. Any suggestions?
  46.  
  47. Thanks in advance,
  48.  
  49. Ed Carty
  50. carty@ists.ists.ca
  51.