I need more info....
These are custom classes, so I do not know what functionality is coded into them (what they do, how they interact).
Nor do i know how complex they are, nor the process required to change them, etc.
But will have a guess....
You need a 'copy' (instance) of the 'OC_TestOptions_Common_c' class, not a pointer.
A pointer to 'm_Options' will change when the user edits the 'm_Options'.
Code:
OC_TestOptions_Common_c TempOptions;
TempOptions= &m_Options;//this will only work if the OC_TestOptions_Common_c class has an 'equals operator' method
//show the user the treeview of options
if( OC_Dlg_PureMFC_Test_Options_c(m_Options).DoModal() != IDOK)
{
m_Options =TempOptions;
}
I can see m_Options is an object of the class 'OC_TestOptions_Common_c'.
Does the 'OC_TestOptions_Common_c' class have a equals operator method?
[many standard classes (ie CString) have operators, your class may not have one]
something like
Code:
//in header
public:
OC_TestOptions_Common_c operator=(OC_TestOptions_Common_c &Options);
//in class
OC_TestOptions_Common_c OC_TestOptions_Common_c::operator =(OC_TestOptions_Common_c &Options)
{
//set all the members of 'this' to the one we have been passed ('Options')
//any members that are derived classes will need their own equals operator
m_Option=Options.m_Option;
m_SomeOtherOption=Options.SomeOtherOption;
etc....
}