|
as mentioned double uses a bit sequence to approximate a floating point number. Exactly describing a floating point number is difficult. But it does depend on your compiler. I just tested float and double:
<br />
0.33333334326744080000 (float)<br />
0.33333333333333331000 (double)<br />
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
VC++ v6
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.
|
|
|
|
|
Has your Document a dirty flag? And does the first page set it?
All in all, the neither the Sheet nor the Pages should hold the Data: The Document should.
And this is also true for any but the most trivial CDialog-based application. The "document" would have another name here or be part of some other class.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
is there a typical way that this is handled? Does the child (property page) send a message to the parent to notify the parent that data has changed?
|
|
|
|
|
The CPropertySheet is a CWnd -descendant. It has a GetParent() function.
You *know* what class its parent is and can cast the parent CWnd -pointer appropriately to call function directly.
Message calls would work also.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
|
littleGreenDude wrote:
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)?
If you are using MFC, check out CPropertyPage::SetModified() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for the suggestion, but it didn't work.
The problem I have is that the screen fields aren't one-to-one with the recordset datafields. I have a single field in the recordset called ProductUse, and this is represented on the screen by 3 checkboxes, one for each of the following; ordering, receiving, counting. So, the dataset has 26 fields, and the form has 28 fields.
|
|
|
|
|
I fail to see the correlation. If you make a change to a property page, you've made a change to a property page, regardless of any recordset that may be involved.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
just to add a little more background info/specifics
I've added the following to DoFieldExchange:
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
m_pSet->SetFieldNull(&m_pSet->m_ProductUse, FALSE);<br />
m_pSet->SetFieldDirty(&m_pSet->m_ProductUse, TRUE);
As I mentioned before, 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:
void cPgInvGenInfo::OnChkReceiving() <br />
{<br />
m_pSet->SetFieldNull(&m_pSet->m_ProductUse, FALSE);<br />
m_pSet->SetFieldDirty(&m_pSet->m_ProductUse, TRUE);<br />
<br />
if( ((CButton*)GetDlgItem(IDC_CHK_RECEIVING))->GetCheck() )<br />
m_pSet->m_ProductUse |= 00000010;<br />
else<br />
m_pSet->m_ProductUse &= 11111101;<br />
}
When I click close on the dialog, it happily closes without prompting to save changes, and exits without saving.
|
|
|
|
|
Why not use:
void cPgInvGenInfo::OnChkOrdering()
{
SetModified();
}
void cPgInvGenInfo::OnChkReceiving()
{
SetModified();
}
void cPgInvGenInfo::OnChkCounting()
{
SetModified();
}
void cPgInvGenInfo::OnOK()
{
}
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I want to change the parent of a dialog so that its parent is the top level dialog (i.e. my main app). What is the correct way of doing this as when I get a pointer to the main dialog and use that the main app stops refreshing its display.
What I want is something like this:
MainApp->Modeless Dialog->Modeless Dialog->Modal Dialog attached to MainApp
I can get this working by callbacks through the code but thought that by simply doing modal_dialog->SetParent ( main_app ) would have the same effect but it doesn't.
cheers,
Andy
|
|
|
|
|
Use the ctor.
CDialog::CDialog (MFC)[^]
explicit CDialog(
LPCTSTR lpszTemplateName,
CWnd* pParentWnd = NULL
);
explicit CDialog(
UINT nIDTemplate,
CWnd* pParentWnd = NULL
);
Maxwell Chen
|
|
|
|
|
thank you, should have thought of that myself rather than looking at more complicated ways of doing it.
many thanks
|
|
|
|
|
Hi all,
What is the use of the __fastcall calling convention ?
Many Thanks
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
|
|
|
|
I have a "Dialogbox program" COriginDlg
I want to open a new dialog box CNewDlg -> using doModal()
In the new dialog box I want to access the original dialog box's variables etc.
Is this possible ??
WHen I try the following
BOOL CNewDlg::OnInitDialog()
{
CDialog::OnInitDialog();
COriginDlg dlg ; <------ ????
int i = dlg.Len ; <----- Try to access the variable 'Len' which is part of the class COriginDlg
< ERROR generated is "ACCESS VIOLATION" ???????
}
Any Ideas on how to do this properly ?
|
|
|
|
|
|
Does COriginDlg derived of CDialog?
|
|
|
|
|
Thanks for the reply.
Yes I think both are derived from CDialog
Both have:
class COriginDlg : public CDialog
class CNewDlg : public CDialog
------
Should I have derived CNewDlg from COrginDlg ???
|
|
|
|
|
sofa_2006au wrote: Should I have derived CNewDlg from COrginDlg ???
Only if CNewDlg is a COrginDlg .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
No box are seperate Dialog box windows with list box controls etc
|
|
|
|