我使用了一个OCX的ActiveX控件,但是在没有安装或者说注册的机器上不能运行,不知道如何解决!是否直接引用pas单元文件就可以呢?如何解决--请大家多多指点

解决方案 »

  1.   

    regsvr32 your.ocx就可以了;
     winexec('regsvr32 your.ocx',sw_showhide);
      

  2.   

    winexec('regsvr32 your.ocx',sw_hide);
      

  3.   

    program RegisterMyOCX;
    uses
      OLECtl, Windows, Dialogs;
    var
      OCXHand: THandle;
      RegFunc: TDllRegisterServer;   //add  to the uses clause
    begin
      OCXHand:= LoadLibrary('c:\windows\system\test.ocx');
      RegFunc:= GetProcAddress(OCXHand, 'DllRegisterServer');  //case sensitive
      if RegFunc <> 0 then 
        RegFunc
      else
        ShowMessage('Error!')
      FreeLibrary(OCXHand);  // You can the same way unregister the OCX: 
      // replace 'DllRegisterServer' by 'DllUnregisterServer'
    end.
      

  4.   

    delphi has a demo to regist a ocx control
      

  5.   

    ……Delphi6\Demos\ActiveX\TRegSvr
    看看也许会有帮助