Declare Function DLLSelfRegister Lib "vb6stkit.dll" (ByVal lpDllName As String) As Integer

解决方案 »

  1.   

    還有一個方法,加入到右鍵中去
    建立一 reg 文件,加入以下內容 :)REGEDIT4
    ; ==========
    ; .DLL files
    ; ==========[HKEY_CLASSES_ROOT\.dll]
    "Content Type"="application/x-msdownload"
    @="dllfile"[HKEY_CLASSES_ROOT\dllfile]
    @="Application Extension"[HKEY_CLASSES_ROOT\dllfile\Shell\Register\command]
    @="regsvr32.exe \"%1\""[HKEY_CLASSES_ROOT\dllfile\Shell\UnRegister\command]
    @="regsvr32.exe /u \"%1\""; ==========
    ; .OCX files
    ; ==========[HKEY_CLASSES_ROOT\.ocx]
    @="ocxfile"[HKEY_CLASSES_ROOT\ocxfile]
    @="OCX"[HKEY_CLASSES_ROOT\ocxfile\Shell\Register\command]
    @="regsvr32.exe \"%1\""[HKEY_CLASSES_ROOT\ocxfile\Shell\UnRegister\command]
    @="regsvr32.exe /u \"%1\""
      

  2.   

    请问怎样使用呢?
    比如,对应regsvr32的 /s /u命令。
      

  3.   

    你担心的是
    Shell 执行的 Regsvr32 与你的主程序是异步执行的!现在你可以引用 Windows Script Host Object Model
    使 Shell 执行的 Regsvr32 与你的主程序是同步执行!
    参阅
    如何使几个 EXE 线性同步执行,而不并行异步执行
    http://www.csdn.net/expert/topic/372/372167.shtm
    '引用 Windows Script Host Object Model
    Private Sub Command1_Click()
    Dim x As New IWshRuntimeLibrary.IWshShell_Class 'v2.0
    'Dim x As New IWshRuntimeLibrary.WshShell 'v5.6
    x.Run "regsvr32 D:\MyVBP\eWskPlus\eWskPlus.dll /s", , True
    End Sub
      

  4.   

    这一句
        Dim x As New IWshRuntimeLibrary.IWshShell_Class 'v2.0
    运行时出错。
      

  5.   

    为什么没有与DLLSelfRegister相匹配的卸载Dll的Function?
      

  6.   

    代码:
    http://www.applevb.com/sourcecode/control.zip
    动态注册和反注册ActiveX的控件
      

  7.   

    每个标准的OCX和DLL,都有一个DllRegisterServer()函数(好像是这个)可以实现控件的动态注册。
      

  8.   

    这个API函数很好用,一定给分。
    现在的问题是怎样把控件注册掉,就象regsvr32 /u的效果一样?
      

  9.   

    每个标准的OCX和DLL,都有一个 DllUnregisterServer 可以把控件注册掉.
      

  10.   

    当前目录下有一个dec.dat控件
    使用如下语句:
    Declare Function DLLUnSelfRegister Lib "dec.dat" (ByVal lpDllName As String) As IntegeriReg = DLLUnSelfRegister(App.Path + "\dec.dat")却没有效果。
    请问是哪里不正确?
      

  11.   

    用DllUnregisterServer就行了。
    如果是两个控件,同时需要注册和反注册,该怎么办?