In my MFC, CMyPorpertyPageDlg is derived from CPropertyPage. How to access its member function from a nonmember function in the same CPP file?.
void Non_Member_Get_PorpertyPage()
{
CMyPorpertyPageDlg* pPageDlg = ....
}
Printable View
In my MFC, CMyPorpertyPageDlg is derived from CPropertyPage. How to access its member function from a nonmember function in the same CPP file?.
void Non_Member_Get_PorpertyPage()
{
CMyPorpertyPageDlg* pPageDlg = ....
}
Use a global or create a dynamic instance inside your non member function.
I did the dynamic instance: CMyPropertyPagedlg* p = new CMyPropertyPagedlg(); This did not work. can you show me in actual code the both methods, if possible?.
Why is it a non-member function?
Can't you pass a pointer to the CMyPropertyPageDlg instance to the non-member function call?
The typical approach there is to pass in a reference or pointer to the function. Failing that, unless you have a global instance of your object, there isn't much you can do.