Solved

c# exeption error on PrinterMonitorComponet.

Posted on 2011-09-14
3
343 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
Comment Utility
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
Comment Utility
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
Comment Utility
ok
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
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:…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

11 Experts available now in Live!

Get 1:1 Help Now