OnMouseMove -> ChooseCursor -> Obj. reference not set to an instance of an obj.

Originally Posted 17 July 2017, 8:51 am EST

  • Originally Posted 17 July 2017, 8:51 am EST

    Hi All,

    I've updated the C1TrueDBGrid from version 4.0.20171.248 to version 4.0.20172.271. Since then some of our users have been getting unhandled "Object reference not set to an instance of an object" exceptions from time to time. These have been written to our application log, but unfortunately I haven't been able to reproduce these exceptions on my end yet. This is the Stack Trace:

    at C1.Win.C1TrueDBGrid.BaseGrid.View.ChooseCursor(Point p)
    at C1.Win.C1TrueDBGrid.BaseGrid.View.OnMouseMove(MouseEventArgs e)
    at C1.Win.C1TrueDBGrid.BaseGrid.ViewList.OnMouseMove(MouseEventArgs e)
    at C1.Win.C1TrueDBGrid.BaseGrid.Frame.doMouseMove(MouseEventArgs e)
    at C1.Win.C1TrueDBGrid.C1TrueDBGrid.doMouseMove(MouseEventArgs e)
    at C1.Win.C1TrueDBGrid.BaseGrid.Frame.OnMouseMove(MouseEventArgs e)
    at System.Windows.Forms.Control.WmMouseMove(Message& m)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at C1.Win.C1TrueDBGrid.BaseGrid.Frame.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)

    Sorry, that I can't provide you with more information or a sample application. Could you please have a look into this though?

    Thank you very much,
    Christian
  • Reply

    Hello,

    Sorry, it is not possible to share the debug version.
    Though, the issue could not be replicated at our end. But, I am discussing this case with the developers if there could be any specific cause behind this exception. And, I will let you know once there is any information from them.

    Regards,
    Meenakshi
  • Reply

    Hello Christian,

    I am sorry to mention but I could not replicate the said behaviour with MouseMove event, at my end. However, a sample replicating the issue would be better. But, could you please share the detailed steps to reproduce and environment details in which the users have faced this issue, so that I can assist you further accordingly?

    Regards,
    Meenakshi
  • Reply

    Hi Meenakshi,

    As far as I know there is no specific operation performed after moving the mouse over the grid. It's a pity, that I can't reproduce the error myself.

    Could you send me a debug version of the C1TrueDBGrid, so that I can get a more detailed stack trace?

    Regards,
    Christian
  • Reply

    Hello Christian,

    Thank you for sharing the details.

    I tried the same in the specified environment. But, the issue could not be replicated at my end.

    Can you kindly share some more details on how the grid is being used at the users' end? Is there any specific operation performed just after moving the mouse over the grid?

    I understand that it can be inconvenient for you and your users. But, since the issue could not be reproduced. Therefore, I can't escalate this to the developers.

    Sorry for the inconvenience.

    Regards,
    Meenakshi
  • Reply

    Hi Meenakshi,

    Thank you. The system environment is:

    Microsoft Windows 7 Professional (6.1.7601 Service Pack 1 Build 7601)
    32 Bit
    Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz, 3201 MHz, 4 Kern(e), 4 logische(r) Prozessor(en)
    4 GB RAM
    Intel(R) HD Graphics
    .NET Framework 4.0.30319.42000

    Regards,
    Christian
  • Reply

    Hi,

    Thank you for providing me with the details. But, it does not seem to be of much help.

    I tried by following these steps. But, this is working fine at my end. Could you kindly share the details of system environment in which the users are facing problem?

    I would need to replicate the issue at my end, first. Once I am able to do so, I would be able to help you better with this.

    Regards,
    Meenakshi
  • Reply

    Hello Meenakshi,

    Thank you very much for looking into this and for your reply. I spoke to our users and tried to replicate the error:

    They enter data into a cell (numbers, dates, text). Sometimes they press Enter, sometimes not, and then use the mouse to click into the next cell or to another control on the form. While they move the mouse cursor over the grid, the application crashes with an unhandled "Object reference not set to an instance of an object" exception.

    The affected users enter a lot of data over the day. But the exception occurs only four or five times a day per user. I haven't been able to replicate the exception so far. Sorry, all I've got are the logged stack traces.

    I've rolled my application back to version 4.0.20171.248. Since then the error has been gone.

    Regards,
    Christian
  • Reply

    Hi,

    Please follow the given blog link:
    http://our.componentone.com/2015/06/08/a-step-ahead-troubleshooting-common-errors-part-ii/

    I have also attached an image for your reference. Hope it helps you.

    Regards,
    Meenakshi

  • Reply

    Hi Meenakshi,

    Thank you very much for your support!

    Christian
  • Reply

    Hello Christian,

    Though the issue could not be replicated at developers' end as well. But, they are providing an internal build for testing. You can find the build on the given link:

    https://www.dropbox.com/s/7ln66kfv1vcjf9f/C1WinForms.4_4.0.20172.273.zip?dl=0<\a>

    After testing, kindly share your observations with us.

    Regards,
    Meenakshi
  • Reply

    Hello Meenakshi,

    Thank you very much! This is very kind!

    Sorry, I don't get the build working with my license. This is the compiler error I get:

    C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2977,5): error MSB6006: "lc.exe" exited with code -1.

    I tried to recreate the licenses.licx file and the project references by removing them and dragging the controls onto a new form, but this didn't work: The references were added to the project, but the licenses.licx wasn't created and the controls weren't added to the form.

    Can you please help me installing the build?

    Regards,
    Christian
  • Reply

    Hi Christian,

    Kindly let me know about the issue exactly you faced while posting. And, I am not sure about how you are trying to add new control to Toolbox in your application. So could you please give me some details about this?

    However, I would suggest you to add control to form normally with build 4.0.20172.271. After this, you can replace the DLL in References of your project, with 4.0.20172.273 build.

    Regards,
    Meenakshi
  • Reply

    Hi Meenakshi,

    Please see the attached file for my reply. I wasn’t able to post it – don’t know why.

    Thanks,
    Christian

    2017/08/Reply.zip
  • Reply

    Hi Meenakshi,

    Thank you very much!

    Christian
  • Reply

    Hello Christian,

    I tried in the same manner but I am not able to face any such issue while posting.

    Please note that only a hotfix has been provided to you and installer is not available for the same. Replacing original entries from Program Files with the new ones does not modify registered entries in GAC, resulting in design-time conflicts.

    Therefore, as mentioned earlier, I would suggest you to add control to form normally with build 4.0.20172.271. After this, you can replace the DLL in References of your project, with 4.0.20172.273 build. Kindly try with this and share your observations here.

    Regards,
    Meenakshi
  • Reply

    Hi Meenakshi,

    I wasn’t able to post my next reply, too. Again, please see the attached zip file.

    Regards,
    Christian

    2017/08/Reply2.zip
  • Reply

    Hi Meenakshi,

    Thank you for your reply. I tried this just again: I added the controls with version 4.0.20172.271, replaced the DLLs with version 4.0.20172.273, removed the C1-references, and replaced them with the new build. Sadly, I still get the "lc.exe" exited with code -1” compiler error. Only when I comment out the LC-Tag in the Microsoft.Common.CurrentVersion.targets file (please see attached screenshot), I can compile the project. But then I get the Evaluation Info Dialog. I’m sorry, I can’t deploy an evaluation version to my users for testing.

    Regards,
    Christian


  • Reply

    Hi Christian!

    When VS creates licenses.licx file, it fills it with specific assembly versions. So, when application is updated with different version, this file won't build. Every line in generated file looks like this:
    C1.Win.C1Schedule.C1Calendar, C1.Win.C1Schedule.4, Version=4.0.20172.274, Culture=neutral, PublicKeyToken=79882d576c6336da

    If it's the problem, you can try to fix it by removing everything after assembly name (for every line):
    C1.Win.C1Schedule.C1Calendar, C1.Win.C1Schedule.4

    Also, you might try to re-generate licenses.licx file with our tool. For this, you can see the given link:
    http://our.componentone.com/2016/01/25/licensing-and-licenses-licx-file-licxgenerator-tool/

    If none of these resolve the issue, you can share a stripped-down sample reproducing the issue, here.

    Regards,
    Meenakshi
  • Reply

    Hi Christian,

    Though there does not seem to be a way other than those discussed earlier. But I am internally discussing this issue with the developers. And I will inform you as soon as there is any information about this.

    Regards,
    Meenakshi
  • Reply

    Hi Meenakshi,

    Thank you very much for your support, the tool, and the tips. Please see the attached samples:

    01: 4.0.20171.248: Our actual production version
    03: 4.0.20172.273: The new build with the old licenses.licxs. Does not compile with error MSB6006.
    04: 4.0.20172.273: The new build with a new licenses.licxs, created with the tool. Does not compile with error MSB6006.

    02: 4.0.20172.273: The new build without a licenses.licxs. Compiles, but runs as evaluation version only. Sorry, got an error uploading this file.

    Regards,
    Christian

    2017/08/01_4.0.20171.248.zip

    2017/08/03_4.0.20172.273_MSB6006.zip

    2017/08/04_4.0.20172.273_MSLicxGenerator_B6006.zip
  • Reply

    Christian,

    Thank you for sharing the samples.

    At my end, your samples could be compiled successfully, without any such error (as you can see in the attached video). I followed the same procedure as mentioned earlier, of replacing C1 DLLs in project references of project.

    Please make sure that you are not placing hotfix DLLs in Program Files, and referencing them from a local folder.

    Regards,
    Meenakshi
    2017/08/Vid_Compilation.gif
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels