如何在程序中用代码注册组件(控件)?

有一组件必须在“开始”->“运行”里面输入注册语句注册,
为了方便客户使用,如何在程序中用代码注册?
例如需要输入“regsvr32 xpbutton.ocx"
---------------------------------------------------------------

IF FILE('xpbutton.ocx')
oll=CREATEOBJECT('Wscript.shell')
oll.RUN("regsvr32 /s xpbutton.ocx",0,.T.) &&注册

  • oll.RUN("regsvr32 /u /s xpbutton.ocx",0,.T.) &&解除注册
    RELEASE oll
    ELSE
    waitstr="缺少 mscomctl.ocx 文件..."
    WAIT waitstr WINDOWS AT SROWS()/2,(SCOLS()-LEN(waitstr))/2 TIMEOUT 5
    CLOSE ALL
    CLEAR ALL
    RETURN
    ENDI
Published At
Categories with 数据库类
comments powered by Disqus