Server.cpp
上传用户:easylife05
上传日期:2007-02-14
资源大小:393k
文件大小:1k
源码类别:

PlugIns编程

开发平台:

Visual C++

  1. // Server.cpp : CServer 的实现
  2. #include "stdafx.h"
  3. #include "Server.h"
  4. // CServer
  5. STDMETHODIMP CServer::GetDataPoint(myGraph** dPointer)
  6. {
  7. AFX_MANAGE_STATE(AfxGetAppModuleState());
  8. // TODO: 在此添加实现代码
  9. //myGraph *mGraph=new myGraph;
  10. //mGraph=m_pDoc->m_GraphHead;
  11. *dPointer=m_pDoc->m_GraphHead;
  12. return S_OK;
  13. }
  14. STDMETHODIMP CServer::NewDataCircle(myGraph* pGraph)
  15. {
  16. AFX_MANAGE_STATE(AfxGetAppModuleState());
  17. myGraph* mGraph;
  18. if (m_pDoc->m_GraphHead==NULL)
  19. {
  20. m_pDoc->m_GraphHead=new myGraph;
  21. m_pDoc->m_GraphHead->mWidth =pGraph->mWidth;
  22. m_pDoc->m_GraphHead->mRed=pGraph->mRed;
  23. m_pDoc->m_GraphHead->mGreen=pGraph->mGreen;
  24. m_pDoc->m_GraphHead->mBlue=pGraph->mBlue;
  25. m_pDoc->m_GraphHead->x=pGraph->x;
  26. m_pDoc->m_GraphHead->y=pGraph->y;
  27. m_pDoc->m_GraphHead->mRate=pGraph->mRate;
  28. m_pDoc->m_GraphHead->next=NULL;
  29. m_pDoc->m_GraphTail=m_pDoc->m_GraphHead;
  30. //m_pDoc->SetModifiedFlag();
  31. }
  32. else
  33. { mGraph=new myGraph;
  34. m_pDoc->m_GraphTail->next=mGraph;
  35. m_pDoc->m_GraphTail=mGraph;
  36. m_pDoc->m_GraphTail->mWidth=pGraph->mWidth;
  37. m_pDoc->m_GraphTail->mRed=pGraph->mRed;
  38. m_pDoc->m_GraphTail->mGreen=pGraph->mGreen;
  39. m_pDoc->m_GraphTail->mBlue=pGraph->mBlue;
  40. m_pDoc->m_GraphTail->x=pGraph->x;
  41. m_pDoc->m_GraphTail->y=pGraph->y;
  42. m_pDoc->m_GraphTail->mRate=pGraph->mRate;
  43. m_pDoc->m_GraphTail->next=NULL;
  44. }
  45. m_pDoc->m_countGraph++;
  46. m_pDoc->SetModifiedFlag();
  47. return S_OK;
  48. }