ghimireniraj
asked on
Communicating between CMySocket and the document.........
I have a SDI application with a CMySocket class derived from the CSocket class. I have CSocketFile archive all ready and pumping data in and out fine...
Now i want to update one of my document data from the OnRecieve of my CMysocket class and then call UpdateAllViews();
How can i communicate between CMySocket and document clss ie set some document data from the OnRecieve handle of CMySocket class.
thanks
Now i want to update one of my document data from the OnRecieve of my CMysocket class and then call UpdateAllViews();
How can i communicate between CMySocket and document clss ie set some document data from the OnRecieve handle of CMySocket class.
thanks
ASKER
>CAAADoc *pDoc = AfxGetMainWnd()->GetDocume nt();
GetDocument() is not a member of CWnd class
GetDocument() is not a member of CWnd class
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The solution was absolutely great .I want to give you more points but i just have 50 right now....
ASKER
The solution was absolutely great .I want to give you more points but i just have 50 right now....
ASKER
I had also solved the problem with a crazy way.
I declared a pointer for my view class
globally like
CSendView* view1;
then i used it as in my socket file as
extern CSendView* view1;
in the initial update of the CSendView
class i had written
view1=this;
But you solution is far better and i will switch to that. It also taught me how i can typecast anduse pointers in other situations.
niraj
I declared a pointer for my view class
globally like
CSendView* view1;
then i used it as in my socket file as
extern CSendView* view1;
in the initial update of the CSendView
class i had written
view1=this;
But you solution is far better and i will switch to that. It also taught me how i can typecast anduse pointers in other situations.
niraj
Hi,
:) well, there will be many solutions to a prob. But, try not use global variables.
VinExpert
:) well, there will be many solutions to a prob. But, try not use global variables.
VinExpert
Have U tried with,
CAAADoc *pDoc = AfxGetMainWnd()->GetDocume
pDoc->strData += Incomingdata;
For that U may have to include AAADoc.h file
Try it out.
VinExpert