Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is there a dirty flag for property pages

Status
Not open for further replies.

Technokrat

Programmer
Jul 20, 2001
92
0
0
US
Is there a dirty flag for property pages. In other words what, or how does a property page communicate to its parent that it is dirty(data has changed)?

I have a dialog with four tabs(property pages), and changes to the first tab are recognized by the dialog and it prompts the user with the standard save changes, yes/no/cancel. If a change is made on a tab other than the first, and a subsequent tab is clicked on, the dialog never recognizes the changes and the close button just exits the dialog without prompting the user or saving any of the changes.
 
just to add a little more background info/specifics

I've added the following to DoFieldExchange:

Code:
DFX_Long(pFX, _T("[ProductUse]"), m_ProductUse, AFX_DAO_DISABLE_FIELD_CACHE);

Which according to the MFC/DAO help says I should be able to manually set the field as dirty so it will be saved by doing the following

Code:
m_pSet->SetFieldNull(&m_pSet->m_ProductUse, FALSE);
m_pSet->SetFieldDirty(&m_pSet->m_ProductUse, TRUE);

The ProductUse field is actually derived from 3 checkboxes on the dialog, one for each of the following ORDERING, RECEIVING, COUNTING. So, as an example, my logic for the user clicking on the Receiving checkbox is as follows:

Code:
void cPgInvGenInfo::OnChkReceiving() 
{
m_pSet->SetFieldNull(&m_pSet->m_ProductUse, FALSE);
m_pSet->SetFieldDirty(&m_pSet->m_ProductUse, TRUE);

if( ((CButton*)GetDlgItem(IDC_CHK_RECEIVING))->GetCheck() )
m_pSet->m_ProductUse |= 00000010;
else
m_pSet->m_ProductUse &= 11111101;
}

When I click close on the dialog, it happily closes without prompting to save changes, and exits without saving.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top