ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  5.1 to 6.0, C++ in Visual Studio 2013 -> crashes
Posted by Kai Roecker on Jun-19-2015 17:54
Dear Peter,

probably, you recommend a specific debug strategy. I updated to the new version 6.0 in a
Visual Studio C++/MFC environment. Though I didn't changed anything in my code, CD
crashes in the "addText" or "TextBox" function within DrawArea. I can't follow the exception
further, since it points to your library and only the chartdir.h is shown in the callstack ...

I would appreciate for any help in this case.

Best,
Kai

  Re: 5.1 to 6.0, C++ in Visual Studio 2013 -> crashes
Posted by Peter Kwan on Jun-20-2015 01:35
Hi Kai,

In C++, there are many reasons why some code may crash. It may or may not be related to
the crashed code itself. For example, it may be due to the object memory being overwritten
or corrupted by another part of the code (like a stack overflow issue), or the pointers
pointing to invalid memory, or the text string is not null terminated, etc. It can also be
caused by inconsistent header files. For example, if part of the code is using ChartDirector
5.1 header files, but the DLL is ChartDirector 6.0, or another part of the code is using the
ChatDirector 6.0 header files, the code may crash.

To troubleshoot the problem, first, please check if the original sample Visual Studio project
that comes with ChartDirector works normally. (Just unzip the distribution without modifying
anything, then double click in the "ChartDirector/mfcdemo/mfcdemo.sln" and compile and
run.) This is to confirm that the ChartDirector is working normally on your machine with your
development environment. Then in your own code, if the error is easily reproducible, you
can look at the stack trace to see where the error occurs, then set a break point, and
examine all the parameters to see if they are correct. For further trouble-shooting, you can
try to simplify your code to create some simple test code that can reproduce the error. For
example, you can try to use only hard coded data for testing. You can remove all parts of
the code except the charting part. Very usually, the problem can be found this way.

If you need further help, is it possible to inform me of the exact stack trace, as well as the
charting part of your code?

Regards
Peter Kwan

  Re: 5.1 to 6.0, C++ in Visual Studio 2013 -> crashes
Posted by Kai on Jun-21-2015 21:34
Dear Peter,

thank you for the quick and kind reply.

Anyway, it is a little bit unsatisfying to me. In general, I've knowledge for the debug routines
in VSC++. But, it is your library that crashes and I thought that it could be interesting for
you to be informed about.

All demo applications run fine with 6.0 (MFC) in my environment. As so, my application
works fine with 5.1, but crashes if I switch to 6.0 - without any changes of the code. These
crashes always appear at the function DrawArea.text ( a function that is not used in your
mfcdemo ... ). This is why I suppose that your code may have modifications in this function
that could be buggy.

For me, this means that I can't use 6.0, since my software uses  DrawArea.text extensively.

If I can help you in any other way, please tell me.

With best regards,
Kai

  Re: 5.1 to 6.0, C++ in Visual Studio 2013 -> crashes
Posted by Peter Kwan on Jun-22-2015 20:21
Hi Kai,

If the error is reproducible, It would be most useful if you can run the code in debug mode,
preferably inside Visual Studio, and inform me of the stack trace when it crashes. This can
help us tremendously to determine where is the issue. If you cannot post the stack trace in
a public forum, you may email me directly at pkwan@advsofteng.net.

The mfcdemo/mfcdemo project itself does not use DrawArea.text, but other projects in the
mfcdemo solution which use track cursors do use DrawArea.text. Examples include
mfcdemo/zoomscrolltrack, mfcdemo/tracklabel, mfcdemo/realtimetrack, etc.. Would you
mind to try at least one of them to see if it works in your environment?

The DrawArea.text itself is not in the "chartdir60.dll". It is in the header file. The source
code in the header file should call CDrawArea_text or some other functions in
"chartdir60.dll", the exact function depends on which of the 8 different DrawArea.text
overloads the code is using, which can be clarified by the stack trace.

Regards
Peter Kwan