.H  
  //   Generated   message   map   functions  
  //{{AFX_MSG(CConnectThread)  
  //}}AFX_MSG  
  afx_msg   LRESULT   OnThreadMessage(WPARAM   wParam,   LPARAM   lParam);  
  DECLARE_MESSAGE_MAP()  
   
  .CPP  
  BEGIN_MESSAGE_MAP(CConnectThread,   CWinThread)  
  //{{AFX_MSG_MAP(CConnectThread)  
  //}}AFX_MSG_MAP  
  ON_MESSAGE(WM_THREADMSG,   OnThreadMessage)----出错  
  //ON_THREAD_MESSAGE(WM_THREADMSG,   OnThreadMessage)  
  END_MESSAGE_MAP()  
   
  afx_msg   LRESULT   CConnectThread::OnThreadMessage(WPARAM   wParam,   LPARAM   lParam)  
  {  
  switch(wParam)  
  {  
  case   0:   //   destroy   data   socket  
  m_ConnectSocket.DestroyDataConnection();  
  break;  
  case   1:   //   quit   !  
  PostThreadMessage(WM_QUIT,0,0);  
  break;  
  default:  
  break;  
  }  
  return   0L;  
  }  
   
  d:\ConnectThread.cpp(146)   :   error   C2440:   “static_cast”   :   无法从“LRESULT   (__thiscall   CConnectThread::*   )(WPARAM,LPARAM)”转换为“LRESULT   (__thiscall   CWnd::*   )(WPARAM,LPARAM)”  

/////////////////////////////////////////
void   OnThreadMessage(WPARAM   wParam,   LPARAM   lParam);  
   
  DECLARE_MESSAGE_MAP()  
   
  .CPP  
  BEGIN_MESSAGE_MAP(CConnectThread,   CWinThread)  
  //{{AFX_MSG_MAP(CConnectThread)  
  //}}AFX_MSG_MAP  
  //ON_MESSAGE(WM_THREADMSG,   OnThreadMessage)----出错  
  ON_THREAD_MESSAGE(WM_THREADMSG,   OnThreadMessage)  
  END_MESSAGE_MAP()  
   
  void   CConnectThread::OnThreadMessage(WPARAM   wParam,   LPARAM   lParam)  
  {  
  switch(wParam)  
  {  
  case   0:   //   destroy   data   socket  
  m_ConnectSocket.DestroyDataConnection();  
  break;  
  case   1:   //   quit   !  
  PostThreadMessage(WM_QUIT,0,0);  
  break;  
  default:  
  break;  
  }  
  return;  
  }  
////////////////////////////////////


Posted on 2007-04-05 13:23 艾凡赫 阅读(994) 评论(0)  编辑 收藏 引用 所属分类: MFC技术

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理