Solved

c# exeption error on PrinterMonitorComponet.

Posted on 2011-09-14
3
346 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 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