要使用Mscomm32.ocx控件,检查是否有该控件。

解决方案 »

  1.   

    那怎么它的类名叫CCommCtrl?是改名了吗?
      

  2.   

    需要控件*.ocx,并需注册
    手工注册如下
    Regsvr32 *.ocx
      

  3.   

    经过注册还是不行?但是我试了其他控件是可以的,还有就是我把CCommCtrl换成CMSComm后,注册控件,后出现创建空文档失败:
    主要代码如下:
    int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
    {//CMSComm m_commctrl;
    ............//#define IDC_COMM1 2001
    // Create the MSCOMM32 OLE Control.
    if (!m_commctrl.Create(NULL,0,CRect(0,0,0,0),this,IDC_COMM1))
    {
    TRACE0("Failed to create OLE Communications Control\n");
    ::AfxMessageBox ("return -1");
    return -1;      // fail to create
    } // Set RThreshold property to 1. The default RThreshold value (0)
    // causes the OnComm event to NOT fire when a character is detected
    // in the serial port.
    m_commctrl.SetRThreshold(1);
             ..........
    }
    问题出现在哪里?
      

  4.   

    to nustchen:怎样检查是否有效?