RE: Printing (to Wolf)
- Posted by Brian Broker <bkb at cnw.com> Mar 04, 2002
- 381 views
Hi Wolf, I'm afraid your assumption is wrong. Win32Lib sets this to NULL and lets PrintDlg allocate memory for the DEVMODE structure, initializing it's members to indicate the user's input. PrintDlg then sets the hDevMode member for later fetching. -- Brian Wolf wrote: > > xPrintDlg is returning 0 and CommDlgExtendedError is returning > > PDERR_INITFAILURE. But only fails on patched version of interpretter. > > I'll keep digging when I get a chance. > Here's something that really confuses a newbie like me! > > -- Win32.hlp says: > If you use the structure to initialize the dialog box controls, you must > allocate space for and create the DEVMODE > structure. (You should allocate a movable block of memory.) > If you do not use the structure to initialize the dialog box controls, > hDevMode may be NULL. In this case, PrintDlg > allocates memory for the structure, initializes its members, and returns > a handle that identifies it. > > -- I'm assuming that win32lib *is* trying to use the structure to > initialize the dialog box, > -- but DEVMODE isn't anywhere in sight ? > i.e: > store( mem, PRINTDLG_lStructSize, SIZEOF_PRINTDLG ) > store( mem, PRINTDLG_nMinPage, 1 ) > store( mem, PRINTDLG_flags, flags ) > store( mem, PRINTDLG_nMaxPage, pMaxPages ) > > -- Perhaps the 3.10 version has an internal 'workaround' exception > handler to 'baby' this, but the 4.0 version does not > ? > > That " hDevMode *may* be NULL " is really explicit > >