"Parameter is not valid.
at System.Drawing.Graphics.GetHdc() at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter..ctor() at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter..ctor(IContainer container) at MyGrid..ctor()"
For some reason, after a period of time, whenever one of my win forms loads, and there's a grid to be initialised, I get the above error. The error persists until the application is restarted. Has anybody else seen this? I am using 8.3.20083.2021. I'm sure I've seen somewhere that it may be down to the number of window handles it uses up, as there is a leak of sorts. I realise that I could upgrade to the latest version, but management will not allow this unless there is a very good reason as it envolves a mass roll out to thousands of user machines. Perhaps there is a hot fix.
If somebody could let me know in which version it was found and perhaps in which version is has been fixed?
Thanks for any help, Andrew
Hi Andrew,
I've never seen an error like this before that I recall.
I suppose a memory leak could explain this. That should be easy enough to check. Bring up your task manager in Windows and there's a Performance tab that shows you the current number of handles.
Hi Mike,
I have an open case number for this - "CAS-40329-O7D41C".
You'll be able to see all the detail in there, but I am suggesting there is a problem with the cached graphics mechanism in the UltraExplorerBar control (which seems to be a univeral mechanism across infragistic controls, including the UltraGridExcelExporter). We are seeing the problem, specifically when an UltraExplorerBar group is selected.
internal void AnimateGroupSelection(UltraExplorerBarGroup newSelectedGroup)(UltraExplorerBar.cs – Line 17485)
(DrawUtility.ReleaseCachedGraphics() is not being called within AnimateGroupSelection which I believe is causing the problem).
In our code, if we select the group .Selected = True we get the error in our main application. If we omit this, the problem goes away.
It took us 3 - 4 days (changeset by changeset in Team Foundation Server) to work this one out.
(I did by the way check the windows handles on a few of our servers where users run the application, and all looked normal. Handles did not go over 600 at any point in the day).
Kind regards,
Andrew
Hi All,
Still getting this issue, but in a new peice of software recently developed it occours everytime on a non-development laptop.
We have made sure that the laptop has the latest .net framework on it, we have re-compiled the software with the latest DLLs as of today and yet I still get this issue on that laptop and that laptop alone. The only thing different on that laptop then all the other computers here is that the laptop is Windows XP.
Googling the error the only thing I can come up with is whatever is calling graphics dll is calling a dispose() method which causes this error. But as this would be within the infragistics dll I cannot check that. Message similar to above copied in below. Is there any more information you need from me?
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************System.ArgumentException: Parameter is not valid. at System.Drawing.Graphics.GetHdc() at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter..ctor() at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter..ctor(IContainer container) at _4CAST.frmMain.InitializeComponent() in C:\Software Development\4CAST Live\4CAST\frmMain.Designer.vb:line 264 at _4CAST.frmMain..ctor(frmMDI& MDIForm) in C:\Software Development\4CAST Live\4CAST\frmMain.vb:line 76 at _4CAST.frmMDI..ctor(frmLogin& loginform) in C:\Software Development\4CAST Live\4CAST\frmMDI.vb:line 12 at _4CAST.frmLogin.btnok_Click(Object sender, EventArgs e) in C:\Software Development\4CAST Live\4CAST\frmLogin.vb:line 58 at _4CAST.frmLogin.txtPassword_KeyPress(Object sender, KeyPressEventArgs e) in C:\Software Development\4CAST Live\4CAST\frmLogin.vb:line 82 at System.Windows.Forms.Control.OnKeyPress(KeyPressEventArgs e) at Infragistics.Win.UltraControlBase.OnKeyPress(KeyPressEventArgs e) at Infragistics.Win.UltraWinEditors.TextEditorControlBase.OnEditorKeyPress(KeyPressEventArgs args) at Infragistics.Win.UltraWinEditors.TextEditorControlBase.OnEditorKeyPress(Object sender, KeyPressEventArgs args) at Infragistics.Win.EmbeddableEditorBase.RaiseKeyPressEvent(KeyPressEventArgs e) at Infragistics.Win.EmbeddableTextBox.OnKeyPress(KeyPressEventArgs e) at Infragistics.Win.EmbeddableTextBoxWithUIPermissions.ProcessKeyMessage(Message& msg) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.TextBoxBase.WndProc(Message& m) at System.Windows.Forms.TextBox.WndProc(Message& m) at Infragistics.Win.EmbeddableTextBoxWithUIPermissions.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Line 264 is the form designer is
Me.ugrScenarioExport = New Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter(Me.components)
Line 76 is :
InitializeComponent()
Hello,
Could you please try to attach if possible a small sample project reproducing the above mentioned issue, I will be happy to take a look at it.
Hi Boris,
I have tried making a sample application that does the same as my main application, i.e. included the same controls open the forms in the same way but I have not been succesful in re-creating the error in a sample application. I really have no idea what causes this. Can't see how its my code, however as its constructor of the form that is failing with the above error, hence why I re-created the design of the form. What is more strange on the PC where the the main app fails it seems now that it only fails 98% not 100%, I cannot see any pattern however.
Really annoying error this one, if anyone can think of any other ways of re-creating this, then I am all ears.
Alex
Hi,
I have the same error when I cancel the export of a grid in PDF or Word with plus than one bands and large amount of data (during the "Measuring and laying out the grid for export to.."). Apparently all work fine but when I try to export another grid is say "Parameter not valid" in the InitializeComponent.
I try to declare the UltraGridWordWriter, UltraGridDocumentExporter and UltraGridExcelExporter as shared and add the handler dynamically in the load form event but now it say "Parameter not valid" during the ExportAsync in the function:
Private Sub BtnExportExcel_Click(sender As System.Object, e As System.EventArgs) Handles BtnExportExcel.Click UltraGridExcelExporterObject.ExportAsync(MyGrid, MyPath)End Sub
I cannot reproduce in a small environment.
I have the last relase of infragistic v12.2
I am still getting this issue infrequently on Production.
It is producing on only one client but I am unable to reproduce it on my local system. I have Infragistics V12.1 Version.
The code which is causing problem is as below:-
this.ultraGridExcelExporter = new Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter(this.components);
Please let me know if this issue is fixed or there is any Hotfix available for this.
Thanks,
Kuldeep Agrawal
That Exception is very vague and can occur for any number of reasons. Have you tried getting the latest service release?
If that doesn't help, can you reproduce the issue in a small sample project and post it here so we can check it out?
We are using Infragistics 14.1 WinForms and we are getting this error from production as well.
is there any solution to this?
Details:
Inner Exception:
Parameter is not valid.
at System.Drawing.Graphics.GetHdc()
at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter..ctor()
at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter..ctor(IContainer container)
its also happened with me in this version 13.1.20131.2124 not in exporting just in initializing in this generated code
Me.UltraGridExcelExporter1 = New Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter(Me.components)
Same link I gave you several posts back.
How to get the latest service release - Infragistics Community
Anyway, threading issues can be like that. They are quirky and sometimes you can just get lucky and they don't happen until you move something around or shift the timing. Or, I could be wrong and the issue is nothing to do with threading.
If you can duplicate the exception in a small sample project, we'd be happy to take a look, but that sample should not include any background threads to eliminate that as the possible cause.
Where can I get the service Release for 13.1.
Yes, my application use background threads. but we didn't have this issue with the earlier version of infragistics but just this release.