MSComm控件,在我的电脑上装了好用。到了客户电脑上就不好用。装过之后放不到窗体上,提示“设计时期不可用”,害得我次次会公司才能修该程序。请问这是什么问题,如何解决?

解决方案 »

  1.   

    // This function returns a pointer to a contained control's site 
    function ClientSite( obj: IUnknown ): IOleClientSite; 
    var 
      Site: IOleClientSite; 
      OleObj: IOleObject; 
    begin 
      if (obj.QueryInterface( IOleObject, OleObj ) = S_OK) and 
         (OleObj.GetClientSite( Site ) = S_OK) then 
        Result := Site 
      else 
        Result := nil; 
    end; // This function returns TRUE if the contained object's container is in 
    // design mode; FALSE if the container is not in design mode or 
    // does not support design mode, or on any failure. 
    // 
    function IsControlInDesignMode( obj: IUnknown ): Boolean; 
    var 
      Mode: Boolean; 
    begin 
      try 
        Mode := not ((ClientSite(obj) as IAmbientDispatch).UserMode); 
      except 
        Mode := False; 
      end; 
      Result := Mode; 
    end;
      

  2.   

    你在客户机上没有注册ocx吧?
      

  3.   

    注册ocx吧,用delphi自身的注册
      

  4.   

    to hblsl(舍予),我还没用过delphi自身的注册,请问如何做?
      

  5.   

    你那个ocx有没有license呢?
    如果有,把yourocx.lic拷贝到%windir%\system32下面