Hi Im writing socket appliction,where server is sending data for every two seconds.
At client side it is a SDI application where the data received need to be plotted as graph.
so Im receiving data at CSockEt_Client::OnReceive()
But how can i reflect on CClientView::OnDraw(CDC *pDC)
to Plot Graph..?
At Server
while(1)
{
for(int i=0;i<col;i++)
{
Sleep(2000);
fdata.w1=a[i][0];
fdata.w2=a[i][1];
fdata.w3=a[i][2];
fdata.w4=a[i][3];
m_server.m_client.Send(&fdata,sizeof(fdata));
}
At Client side
void CClient_Socket::OnReceive(int nErrorCode)
{ filedata fdata;
int br=Receive(&fdata,sizeof(fdata));
w[0]=fdata.w1;
w[1]=fdata.w2;
w[2]=fdata.w3;
w[3]=fdata.w4;
CSocket::OnReceive(nErrorCode);
}
void CClient_graphView::OnDraw(CDC* dc)
{
CClient_graphDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
m_Graph->DrawGraph(dc); m_Graph->AddPoint(dc, w[0]);
}
so in what way i need to declare int w[i]... either static,extern...?
please help me out..
Thanks in advance..