D
drummond.ian
Hello Everyone,
This problem's been causing me a lot of trouble and I'm hoping
somebody can help me out!!
I have a dialog-based MFC application in visual studio 2003. I want to
call a function called "OnPrintMsg" from my dialog class called
"MyAppDlg.h". The function needs to be called from another class called
"Client.cpp". The Client class (derived from the CSockets class) exists
as described below.
MyAppDlg.h
....
CClient myclient; //The CClient class is another class that I created.
It inherits from CSocket.
void OnPrintMsg(); // This function is in my dialog application
....
//Client.cpp
CClient::OnReceive() // This function is called from my Client Class
upon receiving information from
// the socket
....
OnPrintMsg(); //want to call function in MyApp dialog with access to
dialog member variables
In a nutshell what I want to do from the OnReceive, is like
CMyApp::OnPrintMsg(); However, when I tried this using a local instance
of the MyApp class, I was unable to access the member variable of the
actual dialog, likely because it was a local instance.
Can anyone help me? Thanks in advance!!
~ Ian
This problem's been causing me a lot of trouble and I'm hoping
somebody can help me out!!
I have a dialog-based MFC application in visual studio 2003. I want to
call a function called "OnPrintMsg" from my dialog class called
"MyAppDlg.h". The function needs to be called from another class called
"Client.cpp". The Client class (derived from the CSockets class) exists
as described below.
MyAppDlg.h
....
CClient myclient; //The CClient class is another class that I created.
It inherits from CSocket.
void OnPrintMsg(); // This function is in my dialog application
....
//Client.cpp
CClient::OnReceive() // This function is called from my Client Class
upon receiving information from
// the socket
....
OnPrintMsg(); //want to call function in MyApp dialog with access to
dialog member variables
In a nutshell what I want to do from the OnReceive, is like
CMyApp::OnPrintMsg(); However, when I tried this using a local instance
of the MyApp class, I was unable to access the member variable of the
actual dialog, likely because it was a local instance.
Can anyone help me? Thanks in advance!!
~ Ian