Kullanılamaz gibi görünen bu kod, sorunu yeniden üretir. Başka bir uygulama, yazıcıya bir yazdırma işi gönderildiğinde bildirim almak için http://printqueuewatch.codeplex.com/ kullanıyor. Çalışır, ancak bazen bir yazdırma işi gönderdiğinizde GetPrintJobInfoCollection burada çöker. İç istisnayı yapıştırdım. Çoğalmak için bir not alıncaya kadar Notepad ++ ya da uygulamamı 20 kez küçük bir metin dosyası ile gönderiyorum. Çarpışmadan sonra GetPrintJobInfoCollection'ı çağırırsanız başarılı bir şekilde çalışır veya tekrar dener.GetPrintJobInfoCollection() İstisna bazen
Bunu nasıl düzeltebilirsiniz?
System.NullReferenceException was unhandled Message=Object reference
not set to an instance of an object. Source=System.Printing
StackTrace:
at MS.Internal.PrintWin32Thunk.AttributeNameToInfoLevelMapping.InfoLevelCoverageList.Release()
at MS.Internal.PrintWin32Thunk.EnumDataThunkObject.GetPrintSystemValuesPerPrintJobs(PrintQueue
printQueue, Queue`1 printObjectsCollection, String[] propertyFilter,
UInt32 firstJobIndex, UInt32 numberOfJobs)
at System.Printing.PrintJobInfoCollection..ctor(PrintQueue printQueue, String[] propertyFilter)
at System.Printing.PrintQueue.GetPrintJobInfoCollection()
at WpfApplication7.MainWindow.button2_Click(Object sender, RoutedEventArgs e) in