Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm using class Pie Chart Wnd that I found in this site, but I have a problem, when program starts in pie chart I have 40.00 and 60.00 percentage values, then when I press a button I must have 30.00 and 70.00 percentage but program blocks;

code:

void CCReadQueryDlg::OnBnClickedButton1()
{
    m_pieChart.m_nPrimoValore = 40.00;
	m_pieChart.m_nSecondoValore = 60.00;

	CRect rect1;
	//rect della pie chart
	rect1.left = 250;
	rect1.top = 10;
	rect1.bottom = 530;
	rect1.right = 1250;

	m_pieChart.Create(L"", rect1, this, 1);//se tolgo questa riga funziona 
}


I have seen that when I press button function On_Create isn't called..what must I write in my code?

What I have tried:

I tried code that I wrote above
Posted
Updated 13-Dec-21 10:36am

Don't post this under Quick Answers - if you got the code from an article, then there is a "Add a Comment or Question" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them.
Posting this here relies on them "dropping by" and realising it is for them.
 
Share this answer
 
Comments
OriginalGriff 13-Dec-21 9:37am    
That helps no one - we still have no idea which of the 15,000,000+ member that might of written the 100,000+ articles you are referring to it might have been ...
If you want help, go to the source, rather than assuming that either the author will see your message, or Anyone else will have a clue which article you are talking about!
Member 14594285 13-Dec-21 9:52am    
I don't find article, I cancel my comment
merano99 13-Dec-21 15:55pm    
The code could fit this project:
A Simple Pie Chart Control - Improved 3-D Pie Chart by PrasadPerera
https://www.codeproject.com/Articles/35759/A-Simple-Pie-Chart-Control-Improved-3-D-Pie-Chart

BOOL CPieChartWnd::Create(LPCTSTR lpCaption, const RECT& rect, CWnd* pParentWnd, UINT nID);

In the example program, the Create method is used as follows:
C++
BOOL CCReadQueryDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
    ... 
	CRect rect;
	GetClientRect(rect);
	rect.left = 250;
	rect.top = 10;
	rect.bottom -= 250;
	rect.right -= 10;
	m_pieChart.Create(L"Pie Chart", rect, this, 1);
Please refer:
A Simple Pie Chart Control - Improved 3-D Pie Chart[^]
 
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