Form with Chart2D crashes program when trying to load second time

Posted by: SatishMatani on 30 March 2019, 1:20 pm EST

  • Posted 30 March 2019, 1:20 pm EST

    I have a program where I open another form with Chart. It loads fine the first time. However after closing it and trying to load the form the second time, program crashes with following error:

    The program '[17384] WindowsApp12.exe' has exited with code -1073740940 (0xc0000374)

    I am able to repeat the error in small separate sample I created. I am attaching the file. Click on Button1, close the new form with chart, click on the Button1. It will crash with above error.

    Any help will be appreciated.WindowsApp12.zip
  • Replied 31 March 2019, 8:03 pm EST

    Hi Satish,

    I could not replicate the issue using the sample you shared. On closing the Form containing Chart and clicking on the Button again, does not cause any error. Can you please try using the following version of Chart 8.0 and see if that makes any difference:
    http://prerelease.componentone.com/activex/c1chart/2017-t3/C1Chart_8.0.20173.103.zip
    http://prerelease.componentone.com/activex/c1chart/2017-t3/C1Chart_8.0.20173.103_x64.zip

    Thanks,
    Pragati

  • Replied 1 April 2019, 4:02 am EST

    Hi Pragati,

    Will you please give me more instruction to how I install these versions?

    As a side note, I don't remember having this problem before. Something that has come up recently and occurs every time.
  • Replied 1 April 2019, 9:03 pm EST

    Hi Satish,

    Since the problem could not be replicated at my end, I cannot comment on its cause. What did you change in recent times? The problem seems specific to your environment.

    In order to install the above mentioned version:
    1. Download the 32 and 64 bit ocx files from the links I shared.
    2. In order to register the ocx files, follow the instructions given in the below mentioned blog article:
    https://www.grapecity.com/en/blogs/registration-of-64-bit-activex-controls

    Thanks,
    Pragati
  • Replied 3 April 2019, 2:51 pm EST

    Hi Pragati,

    I tried out this on different computer with fresh VS and ComponentOne install. I am getting the same error. I also tried on both computers with new versions of control you provided. Having the same problem.

    Thanks
  • Marked as Answer

    Replied 8 April 2019, 8:27 pm EST

    Satish,

    I could not replicate this issue on different machines at my end. Can you please share your environment details (OS, architecture and VS version) so that I can investigate the issue further?

    ~Pragati
  • Replied 15 April 2019, 12:22 am EST

    Machine 1:
    OS: Windows 10 Pro
    Version: 0.017134 Build 17134
    Architecture: AMD 64
    VS Version: 2017 (also tired using 2019)

    Machine 2:
    Windows 10 Pro
    Version: 0.017134 Build 17134
    Architecture: AMD 64
    VS Version: 2017


  • Replied 23 April 2019, 4:55 pm EST

    Hi Satish,

    I could replicate the issue on a Windows 10 machine at my end. I have escalated it to the developers (Internal Tracking ID: 376154) and will let you know once there is any information from them.

    Thanks,
    Pragati
  • Replied 20 May 2019, 1:43 pm EST

    Pragati,

    Just wondering if there is any update on this issue.

    Thanks,
  • Replied 20 May 2019, 4:07 pm EST

    Hi Satish,

    I am getting in touch with the developers regarding the status. Will get back to you once there is anything from them.

    Thanks,
    Pragati
  • Replied 23 June 2019, 6:25 pm EST

    Hi Satish,

    There are two issues with the sample program that made the problem go away. The indexing was odd and the x() and y() arrays were variants. Note that the built in interop for SafeArrays of variants does not work well in WinForms, so the arrays should be typed explicitly.

    GetData without ReDim for each point, and correct indexing.

    Sub GetData()
    Ls = -5
    Le = 15
    r = 0

    For i = Ls To Le Step 0.01
    r = r + 1
    Next

    ReDim Preserve x(r - 1)
    ReDim Preserve y(r - 1)

    r = 0
    For i = Ls To Le Step 0.01
    x(r) = i
    y(r) = i ^ 2 * 15
    r = r + 1
    Next
    End Sub


    GlobalVariables Module.

    Module GlobalVeriables
    Public r As Integer
    Public Ls As Double
    Public Le As Double
    Public x() As Double
    Public y() As Double
    End Module


    Making the above changes will solve the problems for you.

    ~Pragati
  • Replied 20 October 2019, 3:09 am EST

    Pargati,

    It eventually crashes. It happens randomly. File attached. Keep clicking on Button1. It may not happen right away. Some time it crashes after three or four clicks and sometime it takes longer or sometime it does not. But after restarting and trying again it will crash. Note the example attached is a short version of the actual program that I am working on. So this is a big issue for me.WindowsApp12 (2).zip
  • Replied 20 October 2019, 10:26 pm EST

    Thanks, Satish.
    I could observe the issue. Let me ask the developers for the same. Will get back to you once there is anything from them.

    ~Pragati
Need extra support?

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

Learn More

Forum Channels