Solved

c# exeption error on PrinterMonitorComponet.

Posted on 2011-09-14
3
350 Views
Last Modified: 2013-12-17
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

0
Comment
Question by:bobdylan75
  • 2
3 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 36540403
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?
0
 

Accepted Solution

by:
bobdylan75 earned 0 total points
ID: 36541022
Sorry,
I have had to change version of the component.
I use an older version which have a second dll file (.resources).
And now my code is running properly.
Thanks.
0
 

Author Closing Comment

by:bobdylan75
ID: 36558854
ok
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question