Проблемы при использовании из сервиса.
Posted: 05 Nov 2009, 16:15
Добрый день!
При сохранении получил исключение вида:
System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
at System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp)
at System.Windows.Forms.MessageBox.Show(String text, String caption)
at CADImport.CADImage.Draw(Graphics e, RectangleF Rect, Region visibleRegion)
at CADImport.CADImage.Draw(Graphics e, RectangleF Rect)
at CADImport.CADImage.(DRect , PixelFormat )
at CADImport.CADImage.SaveToFile(String FileName, ImageFormat ImgFormat, DRect curRect)
Виноват был, конечно, сам - два потока пытались сохранить в один файл, но естественно не ожидал, что кто-то будет пытаться вывести что-то на экран.
С уважением, Михаил.
При сохранении получил исключение вида:
System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
at System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp)
at System.Windows.Forms.MessageBox.Show(String text, String caption)
at CADImport.CADImage.Draw(Graphics e, RectangleF Rect, Region visibleRegion)
at CADImport.CADImage.Draw(Graphics e, RectangleF Rect)
at CADImport.CADImage.(DRect , PixelFormat )
at CADImport.CADImage.SaveToFile(String FileName, ImageFormat ImgFormat, DRect curRect)
Виноват был, конечно, сам - два потока пытались сохранить в один файл, но естественно не ожидал, что кто-то будет пытаться вывести что-то на экран.
С уважением, Михаил.