please help with wizard and property sheet 
Author Message
 please help with wizard and property sheet

I'm trying to create a wizard that will eventually be a FrontPage
wizard.  I haven't gotten to the FrontPage part yet, because....

I've got the pages created, designed and all, but when I run the program

(just to look at the default behavior), I get an Assertion error.  If I
ignore it, the program works fine. Debugging has left me stumped as
well.  I have traked the error down to the DoModal call for the property

sheets.  the code looks someting like...

int nreturn;

CPage1 page1;
CPage2 page2;
CPropertysheet prop;
prop.AddPage(&page1);
prop.AddPage(&page2);
prop.SetWizardMode();

nreturn = prop.DoModal();
if(nreturn == IDCANCEL)
{
    ...

Quote:
}

Like I said.. rem the DoModal() and things are fine (except no property
of course).  The Assertion says it is at line 224 of dlgprop.cpp.  I
checked that line and it is an assertion of this for one of the pages.
Am I doing something wrong??  My CPage classes were ClassWizard created.

BTW. Using VC++ 4.0...

Thanks, Jason



Thu, 30 Mar 2000 03:00:00 GMT  
 please help with wizard and property sheet

Hi Jason,

The first thing I'd recommend is putting the pages as member variables of
the property sheet and instantiating them in your constructor.  Then in the
OnInitDialog override of the property sheet setting the wizard mode.

CPropertysheet.h
=============
#include "page1.h"
#include "page2.h"

class CPropertysheet : public CPropertySheet
{
public:
        // constructors

protected:
        CPage1 m_Page1;
        CPage2 m_Page2;

protected:
        void Initialize( void );        // I use one function because there are two                    
// constructors.

Quote:
};

CPropertysheet.cpp
===============

CPropertysheet::CPropertysheet( ... )
{
        Initialize();

Quote:
}

CPropertysheet::CPropertysheet( ... )
{
        Initialize();

Quote:
}

void CPropertysheet::Initialize( void )
{
        AddPage( &m_Page1 );
        AddPage( &m_Page2 );

Quote:
}

BOOL CPropertysheet::OnInitDialog()
{
        SetWizardMode();
        return( true );

Quote:
}

Calling function:
============
{
        int nreturn;
        CPropertysheet prop;
        if ( (nreturn= prop.DoModal()) == IDOK )
        {
        }
        else if ( nreturn == IDCANCEL )
        {
        }

Quote:
}

HTH
--
===================
Frank Hickman
SecurTech, Inc.


===================



Thu, 30 Mar 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. please help with wizard and property sheet

2. Help Button on Property Sheet Wizard

3. Property Sheet, wizard, context-sensitive help

4. Help button in property sheet wizard

5. property sheet wizard - using Help button to throw modal dialog and not use .HLP

6. Creating Property Sheets and Property Pages w/o the Class Wizard

7. Please help : Updating controls in property sheets

8. Property Sheet within a Property Sheet

9. Property sheet from property sheet

10. Q: Property sheet within a property sheet

11. Relative Newbie Question: DAO and Property Sheet Wizard

12. Disable NEXT button a wizard property sheet

 

 
Powered by phpBB® Forum Software