Link to home
Start Free TrialLog in
Avatar of bobdylan75
bobdylan75Flag for Afghanistan

asked on

c# exeption error on PrinterMonitorComponet.

Hi,
I'm using PrinterQueueWatch (open suorce library)
but at runtime it gives me an exception
not specified on creation of new object PrinterMonitorComponent.
(where there are >>>>>>>>>>>>>>>)
why?
see code attached
try
            {
                PrinterMonitorComponent Monitor = new PrinterMonitorComponent();
            Monitor.MonitorJobAddedEvent = false;
            Monitor.MonitorJobDeletedEvent = false;
            Monitor.MonitorJobSetEvent = true;
            Monitor.MonitorJobWrittenEvent = false;
            Monitor.MonitorPrinterChangeEvent = false; >>>>>>>>>>     Monitor.JobSet +=  new PrinterMonitorComponent.PrintJobEventHandler(SetPrintJob);
            Monitor.DeviceName = PrinterName;
        }
        catch (Exception ex) { Console.WriteLine(ex.Source.ToString()); };
            
            Prt_Proc.Start();
            
            //Prt_Proc.WaitForExit();
            int Timeout=180;
            do 
            {
                System.Threading.Thread.Sleep(1000);
                Timeout-=1;
            } while(Timeout > 0 && !Prt_Proc.HasExited);

            //Monitor.JobSet -= SetPrintJob;
                ////Prt_Proc.CloseMainWindow();
                                    
            return true;
        }

Open in new window

Avatar of Bob Learned
Bob Learned
Flag of United States of America image

I don't know that component.  The description of the exception doesn't make sense.  Can you attach the full stack trace for the run-time exception?
ASKER CERTIFIED SOLUTION
Avatar of bobdylan75
bobdylan75
Flag of Afghanistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bobdylan75

ASKER

ok