We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Unhandled exception in Grid

I have an application where we have recently started using Windows login impersonation. After adding the impersonation code we started getting an unhandled exception from the Syncfusion grid controls. Below is the exception message and the stack trace to one grid. The problem happens on all grids in the application. I''ve also attached a screen capture with the exception. We are using Syncfusion Essential Suite v2.0. Any help would be appreciated. Patrick Little Invalid image format. The image file may be corrupt. Parameter name: stream at Syncfusion.Windows.Forms.Grid.GridCursors.GetCursor(String cursorName) at Syncfusion.Windows.Forms.Grid.GridCursors.get_DragSelectionCursor() at Syncfusion.Windows.Forms.Grid.GridOleDataSourceMouseController.get_Cursor() at Syncfusion.Windows.Forms.MouseControllerDispatcher.get_DisplayCursor() at Syncfusion.Windows.Forms.MouseControllerDispatcher.ProcessMouseMove(MouseEventArgs e) at Syncfusion.Windows.Forms.MouseControllerDispatcher.TimerTick(Object sender, EventArgs e) at System.Windows.Forms.Timer.OnTick(EventArgs e) at System.Windows.Forms.Timer.Callback(IntPtr hWnd, Int32 msg, IntPtr idEvent, IntPtr dwTime) GridException_6199.zip

13 Replies

AD Administrator Syncfusion Team January 5, 2005 03:42 PM UTC

I have search both our forum posts and our direct trac incident database to see if anyone has ever reported a similar exception stack, and could not find any hits. Are you using multiple threads? Threading problems can give strange exceptions. The stack suggests the problem is occurring in the OLE code. You can turn this support off by setting removing flags in the grid.ControllerOptions property just to check if removing this support avoids the problem. If you can upload a sample project showing the problem, we can try to debug it here.


PA Patrick January 5, 2005 06:01 PM UTC

>Are you using multiple threads? Threading problems can give strange exceptions. > No, we''re not using treads. >The stack suggests the problem is occurring in the OLE code. You can turn this support off by setting removing flags in the grid.ControllerOptions property just to check if removing this support avoids the problem. > What are the flags and I''ll give it a try. >If you can upload a sample project showing the problem, we can try to debug it here. I cut a form from our applicaiton and reduced it to a minimum. I don''t know if it will still cause the error for you. For me it only occurs if I impersonate a company wide domain account. When I use a local machine account I don''t get the error and things work ok. I''ve attached the program for you to look at. You will need to supply a username, password and domain. The username and password need to be different than the account your working from. I have noticed it seems to occur after you select a cell and then when you click in another cell the error happens. Are you loading a cursor on the transition? The hour glass? Thanks Patrick Test1_5817.zip


AD Administrator Syncfusion Team January 5, 2005 09:43 PM UTC

You can set the ControllerOptions from the PropertyGrid for the grid in the designer. Uncheck the two OLE flags, or from code. this.gridControl1.ControllerOptions = GridControllerOptions.All & (~GridControllerOptions.OleDataSource); or in VB.NET Me.gridControl2.ControllerOptions = GridControllerOptions.All And Not GridControllerOptions.OleDataSource


PA Patrick January 6, 2005 01:29 PM UTC

That helped a little, you can click on the data area of the grid and the exception does not occur. However if you click on any of the row or column headers the error still occurs. Does the stack trace help find the area in the code that is causing the problem? Also do you have any idea why the error would occur when your trying to load a cursor? Thanks Patrick


AD Administrator Syncfusion Team January 6, 2005 03:38 PM UTC

I really have no firm idea why a cursor in a resource would give such an error. It looks like something is corrupting the resource stream when the cursor is being loaded. Is any part of your application unmanaged code that might step on the managed resources? I tried to run your sample yesterday but could never get it to accept any logon information. You might consider trying our 3.0.1.0 version to see if this problem is still in that version. But we did a comparisom in the paricular file with these cursors and no code has change there since before 1.6. If you own the source code, you can use our assembly manager to build a debug version of our libraries. Then you could step into the code when the exception happens and maybe that would yield more information.


PA Patrick January 6, 2005 04:52 PM UTC

>I really have no firm idea why a cursor in a resource would give such an error. It looks like something is corrupting the resource stream when the cursor is being loaded. Is any part of your application unmanaged code that might step on the managed resources? > No, the app is all VB.NET. Like I said earlier, it only happens when you use the impersonation code. My guess is that there''s some type of security error going on with the framework. Your not catching the error and dealing with so I''m getting the exception message pop up on my screen. >I tried to run your sample yesterday but could never get it to accept any logon information. > All you need to do is change the Nothing in username, password, and domain to those that are valid on your network. szUser = Nothing szDomain = Nothing szPassword = Nothing >You might consider trying our 3.0.1.0 version to see if this problem is still in that version. But we did a comparisom in the paricular file with these cursors and no code has change there since before 1.6. > I was afraid you were going to suggest that. Unfortunalty we do not have an option of upgrading all our users at this time and I don''t think that would really solve the problem. >If you own the source code, you can use our assembly manager to build a debug version of our libraries. Then you could step into the code when the exception happens and maybe that would yield more information. > Unfortunatly I don''t own the code so I can''t debug the problem myself.


AD Administrator Syncfusion Team January 6, 2005 05:09 PM UTC

>All you need to do is change the Nothing in username, password, and domain to those that are valid on your network. szUser = Nothing szDomain = Nothing szPassword = Nothing I actually tried this with my network info but it did not work for me. I am not sure we are using the same networking protocols. We are running a Windows 2003 server.


PA Patrick January 7, 2005 06:00 PM UTC

>>All you need to do is change the Nothing in username, password, and domain to those that are valid on your network. > >szUser = Nothing >szDomain = Nothing >szPassword = Nothing > > >I actually tried this with my network info but it did not work for me. I am not sure we are using the same networking protocols. We are running a Windows 2003 server. We are to. My normal login account is MFoods\prl In the app I''m using szUser = "MBApp" szDomain = "MFoods" szPassword = "newpassword" My account stays the same but the app is now using the MBApp accout to talk to the SQL server. We really need this problem fixed. The only thing holding up releasing this version of the app is the bug in the Syncfunsion Grid. Thanks Patrick


AD Administrator Syncfusion Team January 7, 2005 09:22 PM UTC

As I understand your description of the problem, things were working OK until you added the login impersonation support. Is that correct? If you comment out that code, does the problem go away? The reason I ask is that I still cannot run your application. Below is a bitmap of the error I am getting. If you look at the call stack, you will see the settings I am trying to use and they are my correct network logon settings. If you can reproduce the error without the logon code, then maybe I can then run your sample and try to debug into the problem. http://www.syncfusion.com/forums/Uploads/logon.zip


PA Patrick January 8, 2005 07:05 PM UTC

>As I understand your description of the problem, things were working OK until you added the login impersonation support. Is that correct? > >If you comment out that code, does the problem go away? Yes, it does. I think it is directly releated to a .NET security issue of some type. > >The reason I ask is that I still cannot run your application. Below is a bitmap of the error I am getting. If you look at the call stack, you will see the settings I am trying to use and they are my correct network logon settings. If you can reproduce the error without the logon code, then maybe I can then run your sample and try to debug into the problem. > What is the descriptive message that is in the exception. If you let it run it will throw the exception and will eventually be caught and displayed in a messge box. Snap shot that and upload it. Thanks Patrick


AD Administrator Syncfusion Team January 8, 2005 08:29 PM UTC

I won''t be back in the office until Monday. But using VPN to try to access our office network from home, here is the messagebox I get. The one I saw at the office was the same message box and I think the same number, but am not 100% sure on that. I will confirm that on Monday. http://www.syncfusion.com/forums/Uploads/logon1.zip


PA Patrick January 10, 2005 01:01 PM UTC

I can reproduce your error only when I type in an invalid username, domain name, or password. That error means that one or more of your login parameters is invalid. Patrick


AD Administrator Syncfusion Team January 10, 2005 04:24 PM UTC

Sorry. The passwor I was using was wrong. I can run your application. I cannot edit the 1st or or 3rd columns? Should I be able to? I can type information in col 2. Here is a picture. http://www.syncfusion.com/forums/Uploads/appilcationBMP.zip How do I see the problem you are having?

Loader.
Up arrow icon