Solved

c# exeption error on PrinterMonitorComponet.

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

Suggested Solutions

Title # Comments Views Activity
Connecting database in Xamarin? 6 54
how to read json value 2 32
free scanner TWAIN can be operated with a Web application 9 41
C# Comparing String Arrays. 5 30
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:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now