This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Windows version of Unix lpr program doesn't work?

>   Colin Peters (
>   Tue, 2 Jun 1998 19:51:18 +0900
>  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
>typedef struct tagPD PRINTDLG, *LPPRINTDLG;
>Where I had earlier defined PACKED to be __attribute__((packed)) in
>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++.

Somewhere in the Microsoft Windows 32 helpfile, there is a statement about
compiling these printer calls for Windows 95 with sizeof(int) == 2.  That
may be the key to the problem, since the 16-bit code works like a charm.

How exactly does one go about setting sizeof(int) == 2 in a Windows 95
compiler, I wonder?

For help on using this list (especially unsubscribing), send a message to
"" with one line of text: "help".

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]