CDialog access !
-
How can i access CDialog class from antoher class that declare in CDialog base application? best regards, M.J.M.
-
How can i access CDialog class from antoher class that declare in CDialog base application? best regards, M.J.M.
mostafa_pasha wrote:
How can i access CDialog class...
Do you mean a
CDialog
-derived class?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
mostafa_pasha wrote:
How can i access CDialog class...
Do you mean a
CDialog
-derived class?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
for example i have CMyFile that is generic class (my project is CDialog base such as CMyDialog) how can i access CMyDialog through CMyFile? is that anyway that call CMyDialog's function from CMyFile class? Best regards. M.J.M.
-
for example i have CMyFile that is generic class (my project is CDialog base such as CMyDialog) how can i access CMyDialog through CMyFile? is that anyway that call CMyDialog's function from CMyFile class? Best regards. M.J.M.
CMyFile::Method()
{
CMyDialog dlg;
dlg.DoModal();
}?
-- Not a substitute for human interaction
-
How can i access CDialog class from antoher class that declare in CDialog base application? best regards, M.J.M.
did you try it? CMainClass *m_Main=(CMainClass*)GetParent(); m_Main->your variables
WhiteSky
-
did you try it? CMainClass *m_Main=(CMainClass*)GetParent(); m_Main->your variables
WhiteSky
Hi, it does not work. GetParent get one argument as HWND. i change it ,
CMainClass *m_Main=(CMainClass*)GetParent(theApp.GetMainWnd()->m_hWnd);
but in dialog base application , compiler say " error C2065: 'theApp' : undeclared identifier" now how can i get pointer to CVerApp class? CVerApp * = ???; which function exist to point to my CVerApp? Best Regards. M.J.M. -
Hi, it does not work. GetParent get one argument as HWND. i change it ,
CMainClass *m_Main=(CMainClass*)GetParent(theApp.GetMainWnd()->m_hWnd);
but in dialog base application , compiler say " error C2065: 'theApp' : undeclared identifier" now how can i get pointer to CVerApp class? CVerApp * = ???; which function exist to point to my CVerApp? Best Regards. M.J.M.How to use this file if you use of GetParent(m_hWnd) what happens?
WhiteSky
-
How to use this file if you use of GetParent(m_hWnd) what happens?
WhiteSky
I have progress bar, i want to change position from my CMyFile class ! CMyFile class is generic class! i just want to change position of bar from my CMyFile so first , i get pointer to my dialog class form CMyFile! then call function SetPos() of my prograss bar class . How can i do that? best regards. MJM
-
for example i have CMyFile that is generic class (my project is CDialog base such as CMyDialog) how can i access CMyDialog through CMyFile? is that anyway that call CMyDialog's function from CMyFile class? Best regards. M.J.M.
mostafa_pasha wrote:
is that anyway that call CMyDialog's function from CMyFile class?
Sure, but why would you want to? By allowing
CMyFile
access to the internals ofCMyDialog
, you have thus tied the two together (i.e., encapsulation). It's especially troublesome if you are wantingCMyFile
to manipulate a UI component (e.g., progress bar) thatCMyDialog
owns. You should be posting a message toCMyDialog
instead.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
I have progress bar, i want to change position from my CMyFile class ! CMyFile class is generic class! i just want to change position of bar from my CMyFile so first , i get pointer to my dialog class form CMyFile! then call function SetPos() of my prograss bar class . How can i do that? best regards. MJM
if this pointer is valid you dont have problem and you must create this pointer once and again use of it for call your class,I hope it helpful for you but if you have problem you can ask :)
WhiteSky