Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C++
CChartStandardAxis* pBottomAxis =
	m_ChartCtrl1.CreateStandardAxis(CChartCtrl::BottomAxis);
CChartStandardAxis* pLeftAxis =
	m_ChartCtrl1.CreateStandardAxis(CChartCtrl::LeftAxis);
pBottomAxis->SetAutomaticMode(CChartAxis::FullAutomatic);
pLeftAxis->SetAutomaticMode(CChartAxis::FullAutomatic);

i wrote these in OnInitDialog() then build&excute,here is the problem,when my cursor moveover the custom control i get the following error
HTML
<img src="https://s1.ax1x.com/2018/04/13/CEHirD.png" alt="CEHirD.png" border="0" />


What I have tried:

after removing code about axes no error occurs
Posted
Updated 17-Apr-18 20:25pm
v4

Please don't post links to images containing error messages. Just copy and paste the error text.

That your application crashes is probably not sourced by creating the axes. Without axes, you can not add data to the control. So when removing the code, later calls to add data will do nothing and the control is empty.

The solution to solve the problem is using a debug build of your application and the chart control and running that from the debugger step by step watching the debug window for trace messages. When the application stops check the call stack.

You may also comment out other portions of your code to know which might be involved.
 
Share this answer
 
I find the solution in the introduction of the control.
Quote:
The control uses dynamic casts internally so RTTI (RunTime Type Information) must be enabled, otherwise a crash will probably occur. RTTI is not enabled by default for VC6, so to enable it open the project settings -> "C/C++" tab -> "C++ language" category and there make sure that the "Enable Run-Time Type Information (RTTI)" check-box is checked.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900