Click here to Skip to main content
15,913,055 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralModal dialog freeze on show Pin
Gian25-Aug-05 2:10
Gian25-Aug-05 2:10 
GeneralRe: Modal dialog freeze on show Pin
CWinThread25-Aug-05 3:19
CWinThread25-Aug-05 3:19 
GeneralDeleting modeless property sheet Pin
rwilmink25-Aug-05 2:03
rwilmink25-Aug-05 2:03 
GeneralRe: Deleting modeless property sheet Pin
David Crow25-Aug-05 3:09
David Crow25-Aug-05 3:09 
GeneralRe: Deleting modeless property sheet Pin
rwilmink25-Aug-05 3:27
rwilmink25-Aug-05 3:27 
GeneralRe: Deleting modeless property sheet Pin
David Crow25-Aug-05 3:44
David Crow25-Aug-05 3:44 
GeneralRe: Deleting modeless property sheet Pin
rwilmink25-Aug-05 4:17
rwilmink25-Aug-05 4:17 
GeneralRe: Deleting modeless property sheet Pin
David Crow25-Aug-05 5:21
David Crow25-Aug-05 5:21 
Ok, then if the property sheet is allocating memory for the pages, it should also free up that memory. Something like:

class MySheet : public CPropertySheet
{
    MyPage *page1;
    MyPage *page2;
    MyPage *page3;
};
 
MySheet::MySheet()
{
    page1 = new MyPage;
    AddPage(page1);
    page2 = new MyPage;
    AddPage(page2);
    page3 = new MyPage;
    AddPage(page3);
}
 
MySheet::~MySheet()
{
    delete page1;
    delete page2;
    delete page3;
}
 
BOOL MySheet::OnCommand( WPARAM wParam, LPARAM lParam ) 
{
    WORD    wNotifyCode,
            wId;
 
    wId         = LOWORD(wParam);
    wNotifyCode = HIWORD(wParam);
 
    if (BN_CLICKED == wNotifyCode)
    {
        if (IDOK == wId)
        {
            if (! ProcOk())
                return TRUE;
        }
    }
 
    return CPropertySheet::OnCommand(wParam, lParam);
}
 
// the OK button was clicked
BOOL MySheet::ProcOk( void )
{
    if (::IsWindow(page1->m_hWnd))
    {
        if (! page1->OnKillActive())
            return FALSE;
    }
    
    if (::IsWindow(page1->m_hWnd))
        page1->OnOK();
 
    return TRUE;
}
 
void MyPage::OnOK()
{
    // the sheet is about to go away.
    // do any page-specific cleanup here
    
    CPropertyPage::OnOK();
}
 
BOOL MyPage::OnKillActive()
{
    // the page is being changed.
    // do any page-specific validation here.
    // return 0 if the page should not change
    
    return CPropertyPage::OnKillActive();
}



"One must learn from the bite of the fire to leave it alone." - Native American Proverb


Questionsetcretiontime Pin
ditty grail25-Aug-05 0:59
ditty grail25-Aug-05 0:59 
AnswerRe: setcretiontime Pin
Dominik Reichl25-Aug-05 1:19
Dominik Reichl25-Aug-05 1:19 
AnswerRe: setcretiontime Pin
David Crow25-Aug-05 3:12
David Crow25-Aug-05 3:12 
QuestionHow to Check/ Uncheck menu item Pin
Hachaso25-Aug-05 0:39
Hachaso25-Aug-05 0:39 
AnswerRe: How to Check/ Uncheck menu item Pin
Rage25-Aug-05 1:16
professionalRage25-Aug-05 1:16 
AnswerRe: How to Check/ Uncheck menu item Pin
hatemtaleb25-Oct-05 0:30
hatemtaleb25-Oct-05 0:30 
QuestionAbout CMonthCalCtrl Pin
parims25-Aug-05 0:34
parims25-Aug-05 0:34 
AnswerRe: About CMonthCalCtrl Pin
ThatsAlok25-Aug-05 1:00
ThatsAlok25-Aug-05 1:00 
QuestionAbout CMonthCalCtrl to display selected Date Pin
parims25-Aug-05 0:30
parims25-Aug-05 0:30 
AnswerRe: About CMonthCalCtrl to display selected Date Pin
Nishad S25-Aug-05 1:31
Nishad S25-Aug-05 1:31 
AnswerRe: About CMonthCalCtrl to display selected Date Pin
David Crow25-Aug-05 3:15
David Crow25-Aug-05 3:15 
Questionlinkage problem Pin
AngelIdan25-Aug-05 0:20
sussAngelIdan25-Aug-05 0:20 
AnswerRe: linkage problem Pin
toxcct25-Aug-05 0:33
toxcct25-Aug-05 0:33 
GeneralRe: linkage problem Pin
sunit525-Aug-05 1:19
sunit525-Aug-05 1:19 
AnswerRe: linkage problem Pin
MailtoGops25-Aug-05 1:34
MailtoGops25-Aug-05 1:34 
QuestionCListView hidden column Pin
study.sourabh24-Aug-05 23:54
study.sourabh24-Aug-05 23:54 
AnswerRe: CListView hidden column Pin
Rage25-Aug-05 1:29
professionalRage25-Aug-05 1:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.