OutOfMemoryException on printer configuration

When I click on "Settings..." inside the Print dialog I often get an OutOfMemoryException.

I never saw this with other applications using the same printer -- just printing without the settings dialog works, too. And the OutOfMemoryException happens with every printer, even the XPS Document Writer.
Any ideas?
bei System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
   bei System.Runtime.InteropServices.Marshal.AllocHGlobal(Int32 cb)
   bei 1PDVkxXqkhARMMk7pBr.jSEaeAXTSTxnqQYYZaq.e82qZ0GR0(PrinterSettings )
   bei 40tZukuuPQuuTEFwOAU.1u2cWiuafaBOGsweRwU.c1E2MrHFQ(Object , EventArgs )
   bei System.Windows.Forms.Control.OnClick(EventArgs e)
   bei System.Windows.Forms.Button.OnClick(EventArgs e)
   bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
   bei System.Windows.Forms.Button.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.RunDialog(Form form)
   bei System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   bei System.Windows.Forms.Form.ShowDialog()
   bei FastReport.Report.ShowPrintDialog(PrinterSettings& printerSettings)
   bei FastReport.Preview.PreparedPages.anphe8qvX(Int32 )
   bei vNG4p25QoKkdedqLfm6.fKx8Yv5FVjFLhQIdMNR.ZclpmQZF2()
   bei FastReport.Preview.PreviewControl.Print()
   bei FastReport.Preview.PreviewControl.xEC6XCj1G(Object , EventArgs )
   bei DevComponents.DotNetBar.BaseItem.RaiseClick(eEventSource source)
   bei DevComponents.DotNetBar.BaseItem.InternalMouseUp(MouseEventArgs objArg)
   bei DevComponents.DotNetBar.PopupItem.InternalMouseUp(MouseEventArgs objArg)
   bei DevComponents.DotNetBar.ButtonItem.InternalMouseUp(MouseEventArgs objArg)
   bei DevComponents.DotNetBar.BaseItem.InternalMouseUp(MouseEventArgs objArg)
   bei DevComponents.DotNetBar.GenericItemContainer.InternalMouseUp(MouseEventArgs objArg)
   bei DevComponents.DotNetBar.Bar.OnMouseUp(MouseEventArgs e)
   bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei DevComponents.DotNetBar.Bar.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.RunDialog(Form form)
   bei System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   bei FastReport.Report.peBNUtn63(Boolean , Form , Form )
   bei FastReport.Report.ShowPrepared(Boolean modal)
   bei FastReport.Report.ShowPrepared()

Comments

  • edited 2:53PM
    Hello,

    What is your PC configuration (OS/CPU/Memory)?
  • edited 2:53PM
    AlexTZ wrote: »
    What is your PC configuration (OS/CPU/Memory)?

    W7 Ultimate (64bit) / x64 (Intel E8400 @ 3.00GHz) / 8 GB (total virtual 16 GB, available 11 GB)
  • edited 2:53PM
    It seems the code that calls the printer Properties window does not work on 64bit. I will try to find a solution.
  • edited 2:53PM
    AlexTZ wrote: »
    It seems the code that calls the printer Properties window does not work on 64bit. I will try to find a solution.

    Even when compiling the application (=.exe) as x86 (instead of AnyCPU)? (Because thats my default for "Debug" configurations since debugging does not work well with 64 bit processes).
  • edited 2:53PM
    I've changed the code a little, it should work in the next build (it will be ready in 3 hours).
  • edited March 2019
    wrong topic

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.