Hi,
I have a dialog which have a button on it.
I want to do one of the following :
1) As the title tells, catch the button click from doc class. As an instance of this dialog is a member variable of doc class.
like,
if( dlgInstance.m_buttonInstance. ...( something like OnClick() )
{
ADocMemberFunction();
}
2) or to get a pointer to the doc class in dialog, like the GetDocument() function in view class.
like,
// dialog.cpp
OnButton()
{
GetTheDoc()->ADocMemberFunction();
}
CTheAppDoc* CTheDialog::GetTheDoc()
{
......
}
Any idea about which method to choose and how to perform this task with the chosen method?
I really need to replace those dots with real code!
Thanks in advance.
I have a dialog which have a button on it.
I want to do one of the following :
1) As the title tells, catch the button click from doc class. As an instance of this dialog is a member variable of doc class.
like,
if( dlgInstance.m_buttonInstance. ...( something like OnClick() )
{
ADocMemberFunction();
}
2) or to get a pointer to the doc class in dialog, like the GetDocument() function in view class.
like,
// dialog.cpp
OnButton()
{
GetTheDoc()->ADocMemberFunction();
}
CTheAppDoc* CTheDialog::GetTheDoc()
{
......
}
Any idea about which method to choose and how to perform this task with the chosen method?
I really need to replace those dots with real code!
Thanks in advance.