home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!utcsri!torn!newshub.ccs.yorku.ca!ists!carty
- From: carty@ists.ists.ca (Ed Carty)
- Subject: Dialog instance data...
- Message-ID: <1992Nov9.161604.2770@ists.ists.ca>
- Organization: Institute for Space and Terrestrial Science
- Distribution: na
- Date: Mon, 9 Nov 92 16:16:04 GMT
- Lines: 40
-
-
- 9 Nov. 1992
-
- Anyone walked this road before...
-
- I'd like to encapsulate instance data with a modeless dialog. I'm creating
- the dialog with CreateDialogParam(), passing initialization data via the
- lParam.
-
- I'm using the standard 'message-cracker' dialog methods, modified as per the
- standard 'message-cracker' window methods, allocating an instance data
- structure on creation, which I'd like to attach to each instance of the
- dialog window.
-
- In <windows.h> there are several interesting things;
-
- /* cbWndExtra bytes needed by dialog manager for dialog classes */
- #define DLGWINDOWEXTRA 30
-
- /* Get/SetWindowWord/Long offsets for use with WC_DIALOG windows */
- #define DWL_MSGRESULT 0
- #define DWL_DLGPROC 4
- #define DWL_USER 8
-
- It seems that the dialog window procedure get 30 extra bytes, with offsets
- for the return long, the dialog procedure and something called DWL_USER. I
- assumed that I could use DWL_USER to attach the pointer to my instance data
- structure, but this causes 'GDI: HFONT not deleted' warnings. It seems
- like windows is using this location...
-
- I ain't got the guts to muck around with the remaining 18 of the 30 extra
- bytes. Also, we're writing a commercial app., and can't risk 'undocumented
- windows' tricks.
-
- Any suggestions?
-
- Thanks in advance,
-
- Ed Carty
- carty@ists.ists.ca
-