Best way to print a linked list w/ OWL printer obj

Best way to print a linked list w/ OWL printer obj

Post by Mark Johns » Tue, 13 Jun 1995 04:00:00



Whats the best way to print out the data from a linked list using the
printer object generated by the AppExpert.  I'd liked to be able
to set page breaks... should i set a flags w/in the linked list structure.

what i seem to get is a bunch of extra blank pages or missing data, as if
it calculated pages but i forced it to page break in the middle of the page
and it didn't send the rest to the next page - instead it just didn't
print...

thanks, mark

 
 
 

1. Printer Interrogation ( we have ways of making you print!)

Here's a tricky little problem I've been battling with over the past few
weeks.
I'm basically trying to wait until a job gets submitted etc. to a
printer, and as far as
I can see in all my docs it should be done as follows. Unfortunately it
always fails as indicated
with the mysterious error code 6 (whatever that is!) Sorry if the code
fragment is a bit long, but
I'm not sure whether the error lies in when I enum printers, set up the
change notify, or
wait for the change.
        If anyone can spot the problem then I will buy them a beer the next
time either they
are in Bournemouth, England or I am where-ever they happen to live :)

        HANDLE printer = 0;
        HANDLE changenotify;
        BOOL didit;
        PRINTER_INFO_1 printers[255];
        PRINTER_DEFAULTS pdefaults;

        pdefaults.pDatatype = NULL;
        pdefaults.pDevMode = NULL;
        pdefaults.DesiredAccess = PRINTER_ACCESS_ADMINISTER;

        didit = EnumPrinters((DWORD)PRINTER_ENUM_NAME,(LPTSTR)"Windows 95 Local
Print Provider",

(DWORD)1,(LPBYTE)printers,sizeof(PRINTER_INFO_1)*255,&needed,&returned);

        didit =
OpenPrinter(printers[0].pName,(LPHANDLE)&printer,(LPPRINTER_DEFAULTS)&pdefaults);

        changenotify =
FindFirstPrinterChangeNotification(printer,PRINTER_CHANGE_ALL,0,NULL);
        if(changenotify == INVALID_HANDLE_VALUE)
        {
                sprintf(buff,"FindFirstPrinterChangeNotification
failed:%d\n",GetLastError());
                MessageBox(buff,"Invalid Handle Value");
        }
        else
        {
                DWORD event;
                event = WaitForSingleObject(changenotify,INFINITE);
                if(event==WAIT_FAILED)
                {
                        sprintf(buff,"failed...%d",GetLastError());
                        MessageBox(buff,"Wait Failed");       // Always fails here returning error
code 6!
                }
                ..... etc.

        p.s. If you do spot the problem then if you could e-mail me at

then I would be v. grateful.

        Thanks in anticipation,
                Dave Mariner.

2. HOT TO DISPLAY VALIDATION ERRORS IN LABEL

3. Printer Pool - Print to multiple printers usings 1 print driver?

4. Load Postscript file

5. Linked lists and indexing the link lists..

6. Here's a new one...

7. Linked List of Linked Lists

8. install anti virus warning 2004

9. linked list to a linked list

10. linked list ->>> doubly linked list

11. whats the best way to save a linked list?

12. Whats the best method to print Trasnparent images on printers using Win32

13. File I/O and Linked List (Best approach?)