 |
|
 |
the code has Memory leak of new Dialog!
|
|
|
|
 |
|
|
 |
|
 |
//create first button
m_pBtnOne = new CButton();
RECT rectOne;
rectOne.left = BTNONE_LOCATION.x;
rectOne.right = BTNONE_LOCATION.x+BUTTON_WIDTH;
rectOne.top = BTNONE_LOCATION.y;
rectOne.bottom = BTNONE_LOCATION.y+BUTTON_HEIGHT;
m_pBtnOne->Create("One", WS_CHILD | WS_VISIBLE | WS_TABSTOP, rectOne, m_pTabDialog, BUTTON_ONE);
//create first dialog
m_pPageOne = new CSuperCenter8Dlg(m_pTabDialog);
if(m_pPageOne->Create(IDD_SUPERCENTER8_DIALOG, m_pTabDialog) == FALSE)// an { ASSERT(::IsWindow(m_hWnd)); ::GetWindowRect(m_hWnd, lpRect); } error occurs here.
I change the IDD_SUPERCENTER8_DIALOG style as your demo project,but still get the error.So i come to you for help.
tks in advance.
|
|
|
|
 |
|
 |
Hi Wang Yingwu,
Thank You very much for this beautifull article.
I tried to implement similar type of project.
I got problem with set focus.
For example, we have 3 edit boxes in the first page.
We can set tab order by Ctrl+D.
When appication runs the edit box for which we given order as 1 shoul get focus.
But here in this application it is not happening.
Can we solve this?
|
|
|
|
 |
|
|
 |
|
 |
I'm not be able to move the position of your button.
If a chage the line in the testconstant.h
const CPoint BTNONE_LOCATION(0,0);
const CPoint BTNTWO_LOCATION(0,0);
const CPoint BTNTHREE_LOCATION(0,0);
nothing change, i can put any value and nothing change...
if a change
const int BUTTON_WIDTH = 73;
const int BUTTON_HEIGHT = 62;
for other value, the button width and height change...
This is the same case if a change in the program the value of rectOne directly....
What happens, i clean and rebuild the project.
//create first button
m_pBtnOne = new CButton();
RECT rectOne;
rectOne.left = BTNONE_LOCATION.x;
rectOne.right = BTNONE_LOCATION.x+BUTTON_WIDTH;
rectOne.top = BTNONE_LOCATION.y;
rectOne.bottom = BTNONE_LOCATION.y+BUTTON_HEIGHT;
m_pBtnOne->Create("One", WS_CHILD | WS_VISIBLE | WS_TABSTOP, rectOne, m_pTabDialog, BUTTON_ONE);
fred
|
|
|
|
 |
|
 |
u could modify the initButtonsShow function yourself in TabDialog.cpp
|
|
|
|
 |
|
 |
Chris was right - someone (me), some time (like now) will need this - and I do! Thank you again Yingwu!
Jerry
Always leap before you look ... it keeps life interesting!
|
|
|
|
 |
|
 |
First, I would like to thank you, the article really give me a lot of idea.
When I am using the, I want to change the tab page by programming without really clicking the buttons, but I failed, any suggestion?
|
|
|
|
 |
|
 |
I also facing the same problem. I want my tab pages to behave like Project Settings in vc++. They should be navigabel using tab keys.
If you have got the solution please reply to me.
|
|
|
|
 |
|
 |
The demo project file seems to be missing.
|
|
|
|
 |
|
 |
Thanks for your remind!
I have informed the web master about this, they are going to change the link.
---
Yingwu Wang
Continuing study will bring you continuing growing.
|
|
|
|
 |
|
 |
Fixed.
cheers,
Chris Maunder
|
|
|
|
 |
|
 |
Thanks!
---
Wang Yingwu
Working hard, study hard, then can upgrade fast!
|
|
|
|
 |
|
 |
There are serious memory leaks in this program:
BOOL CTabDialogTestDlg::InitTabDialog()
{
...
m_pTabDialog = new CTabDialog(IDD_TABDLG, this); // should be recycled.
...
}
BOOL CTabDialogTestDlg::AddPagesToTabDialog()
{
...
CButton* pBtnOne = new CButton(); // should be recycled
...
CPageOneDlg* pPageOne = new CPageOneDlg(m_pTabDialog); // should be recycled
...
CButton* pBtnTwo = new CButton(); // should be recycled
...
CPageTwoDlg* pPageTwo = new CPageTwoDlg(m_pTabDialog); // should be recycled
...
CButton* pBtnThree = new CButton(); // should be recycled
...
CPageThreeDlg* pPageThree = new CPageThreeDlg(m_pTabDialog); // should be recycled
}
|
|
|
|
 |
|
 |
Thanks for your correction.
I have updated the article today and sent over to the web master, they will update for me very soon I think.
Welcome for any other suggestion/recommendation.
how is it?
|
|
|
|
 |
|
 |
There is a use for everything, and somebody will find your sample useful at that right moment!
Good job, and keep aiming for bigger challenges.
William
Fortes in fide et opere!
|
|
|
|
 |
|
 |
That's pretty much reflects my feelings on the article when it was submitted. Thinking back to some of the stuff I've written I thought "yep - someone, somewhere will need something like this".
cheers,
Chris Maunder
|
|
|
|
 |
|
 |
The class has been developed as an introduction of the new framework, however, it seems to be too simple.
Thanks for the encouragement!
I will continue to work and hopefully post more useful and interesting article.
------
Wang Yingwu
Study everyday, grow everyday!
|
|
|
|
 |