Technocrat
Dec 12th, 2000, 10:04 AM
This is an FYI:
Ok no one could figure out my problem of accessing a function or VAR in a protected class. No one answered my previous two posts about how to send text to an edit box from a function in a different class. So after two frustrating, angery, and sleepless nights I figured it out.
This will allow you access to functions and VARs in a protected class, or any class that you do not want to create another instance of. I am not sure if this is the correct way to do this, but it worked for me.
((NAME OF CLASS*)(AfxGetApp()->m_pMainWnd))->VAR OR FUNCTION
In my previous example:
http://forums.vb-world.net/showthread.php?threadid=43722
I could do
((CQueryDlg*)(AfxGetApp()->m_pMainWnd))->PushText("WHATEVER");
For
http://forums.vb-world.net/showthread.php?threadid=44107
I can do
((CMainDlg*)(AfxGetApp()->m_pMainWnd))->m_txtOut = "Whatever";
((CMainDlg*)(AfxGetApp()->m_pMainWnd))->m_txtOut = UpdateData(FALSE);
Ok no one could figure out my problem of accessing a function or VAR in a protected class. No one answered my previous two posts about how to send text to an edit box from a function in a different class. So after two frustrating, angery, and sleepless nights I figured it out.
This will allow you access to functions and VARs in a protected class, or any class that you do not want to create another instance of. I am not sure if this is the correct way to do this, but it worked for me.
((NAME OF CLASS*)(AfxGetApp()->m_pMainWnd))->VAR OR FUNCTION
In my previous example:
http://forums.vb-world.net/showthread.php?threadid=43722
I could do
((CQueryDlg*)(AfxGetApp()->m_pMainWnd))->PushText("WHATEVER");
For
http://forums.vb-world.net/showthread.php?threadid=44107
I can do
((CMainDlg*)(AfxGetApp()->m_pMainWnd))->m_txtOut = "Whatever";
((CMainDlg*)(AfxGetApp()->m_pMainWnd))->m_txtOut = UpdateData(FALSE);