From: vtailor AT gte DOT net Subject: RE: Windows version of Unix lpr program doesn't work? 4 Jun 1998 13:53:43 -0700 Message-ID: <199806040225.VAA00825.cygnus.gnu-win32@smtp1.mailsrvcs.net> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit To: gnu-win32 AT cygnus DOT com Cc: vtailor AT gte DOT net > vtailor AT gte DOT net > Tue, 2 Jun 1998 18:56:50 -0500 (CDT) > >> Colin Peters (colin AT fu DOT is DOT saga-u DOT ac DOT jp) >> Tue, 2 Jun 1998 19:51:18 +0900 >> >>vtailor AT gte DOT net wrote: >>>The reason that the PrintDlg() call fails under __WIN32__ is that >>>sizeof(PRINTDLG) == 68, but the operating system gives an error >>>message unless you set the pd.lStructSize member to 66. This, of >>>course, doesn't happen in the 16-bit Windows 3.x version. Once >>>you get the PrintDlg() call to work, you then discover that all >>>succeeding calls to Escape and TextOut succeed, but the program >>>still fails to print. Oh yes, Borland C++ Builder for Windows 95 >>>gives similar results, and substituting more modern calls doesn't >>>seem to make any difference. >> >>The sizeof(PRINTDLG) will give 66 if you modify the Win32 headers to make >>the PRINTDLG structure >>packed. I did this by changing the line of Windows32/Structures.h >> >>} PRINTDLG, *LPPRINTDLG; >> >>To >> >>} PACKED; >> >>typedef struct tagPD PRINTDLG, *LPPRINTDLG; >> >>Where I had earlier defined PACKED to be __attribute__((packed)) in >>Windows32/Defines.h >> >>Perhaps this will fix the problem? >> >I tried what you suggested, and the call to PrintDlg() succeeded. Then, >all subsequent calls to TextOut and Escape also succeeded, but 32-bit >printing failed. That brings MINGW32 up to par with Borland Builder C++. > I have another piece of the puzzle. If you initialize the PRINTDLG structure sent to the PrintDlg() call as follows pd.Flags = (DWORD)(PD_RETURNDC | PD_PAGENUMS); the 16-bit program gives you a dialog box in which the `Pages' button is checked, while the 32-bit MINGW32 version gives you a dialog box in which `All' is checked, and `Pages' is disabled. There seems to be a slip 'twixt the cup and the lip somewhere. - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".