试试:if (AfxGetApp() != NULL && AfxGetApp()->m_pMainWnd != NULL) 
{
  CStatusBar* pStatus = (CStatusBar*) AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_STATUS_BAR);
  if (pStatus != NULL) 
  {
     pStatus->SetPaneText(0, "hello world");
     pStatus->UpdateWindow();
   }
}
这里还有很多有关状态条的应用
http://www.codeguru.com/statusbar/index.shtml

解决方案 »

  1.   

    给你一个十分好用的函数用法象打印函数
    StatusBarMessage("%s你好,你的IP地址为%s, 端口号为%d", SName, SIPAdd, i);//状态行输出信息
    void StatusBarMessage(char* fmt, ...)
    {
    if (AfxGetApp() != NULL && AfxGetApp()->m_pMainWnd != NULL) {
    char buffer[256];
    CStatusBar* pStatus = (CStatusBar*) 
    AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_STATUS_BAR);
    va_list argptr;
    va_start(argptr, fmt);
    vsprintf(buffer, fmt, argptr);
    va_end(argptr);
    if (pStatus != NULL) {
    pStatus->SetPaneText(0, buffer);
    pStatus->UpdateWindow();
    }
    }
    }
      

  2.   

    在右键properties,中的general,m提示中输入
      

  3.   

    .....
    CStatusBar* pStatus = (CStatusBar*) AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_STATUS_BAR);
    .....
    pStatus->SetPaneText(0, "ok?");
         pStatus->UpdateWindow();