<button id="imseu"></button>
  • <rt id="imseu"></rt>
    <li id="imseu"><source id="imseu"></source></li>
  • <button id="imseu"><input id="imseu"></input></button>
    <table id="imseu"></table>
  • <strike id="imseu"></strike>
    查看: 2054|回復: 1
    打印 上一主題 下一主題

    Regsvr32 用法和錯誤消息的說明

    [復制鏈接]
    跳轉到指定樓層
    樓主
    發表于 2010-10-12 23:30:49 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
    對于那些可以自行注冊的對象鏈接和嵌入 (OLE) 控件,例如動態鏈接庫 (DLL) 文件或 ActiveX 控件 (OCX) 文件,您可以使用 Regsvr32 工具 (Regsvr32.exe) 來將它們注冊和取消注冊。

    Regsvr32.exe 的用法

    RegSvr32.exe 具有以下命令行選項: Regsvr32 [/n] [/i[:cmdline]] dllname

       /u - Unregister server<BR/>
       /i - Call DllInstall passing it an optional [cmdline];
            when used with /u calls dll uninstall
       /n - do not call DllRegisterServer; this option must
            be used with /i

    當您使用 Regsvr32.exe 時,它會嘗試加載該組件并調用它的 DLLSelfRegister 函數。如果此嘗試成功,Regsvr32.exe 會顯示一個指示成功的對話框。如果此嘗試失敗,Regsvr32.exe 會返回一條錯誤消息,其中可能會包括一個 Win32 錯誤代碼。要查看 Win32 錯誤代碼的列表,請參見下面的 Microsoft Web 站點:  
    http://msdn.microsoft.com/librar ... n32_error_codes.asp  

    例如,要手動注冊 Sample.ocx ActiveX 控件,請在 MS-DOS 提示符處鍵入以下命令:  
    c:\regsvr32.exe sample.ocx

    Regsvr32.exe 錯誤消息

    以下列表介紹了 RegSvr32 錯誤消息和可能的原因。  

    Unrecognized flag:/invalid_flag

    鍵入的標志或開關組合無效(請參閱本文中的“Regsvr32.exe 的用法”一節)。  

    No DLL name specified.

    未包括 .dll 文件名(請參閱本文中的“Regsvr32.exe 的用法”一節)。  

    Dllname was loaded, but the DllRegisterServer or DllUnregisterServer entry point was not found.

    Dllname 不是 .dll 或 .ocx 文件。例如,鍵入 regsvr32 wjview.exe 就會生成該錯誤消息。  

    Dllname is not an executable file and no registration helper is registered for this file type.

    Dllname 不是可執行文件(.exe、.dll 或 .ocx)。例如,鍵入 regsvr32 autoexec.bat 就會生成該錯誤消息。

    Dllname was loaded, but the DllRegisterServer or DllUnregisterServer entry point was not found.

    Dllname 可能未導出,或者內存中可能有損壞的 Dllname 版本。請考慮使用 Pview 來檢測該文件并刪除它。  

    Dllname is not self-registerable or a corrupted version is in memory.

    例如,鍵入 regsvr32 icwdial.dll 后就會返回該錯誤消息,因為 Icwdial.dll 文件不能自行注冊。如果您懷疑內存中有損壞的 Dllname 版本,請嘗試重新啟動計算機,或重新提取該文件的原始版本。如果您運行的是 Windows NT,可能需要使用 Microsoft Windows NT Server 4.0 資源工具包 中的 Kill 或 Pview 工具。有關其他信息,請單擊以查看以下 Microsoft 知識庫文章:  
    197155 如何終止孤立進程  

    OleInitialize failed (or OleUninitialize failed).

    Regsvr32 必須先初始化 COM 庫,然后才能調用所需的 COM 庫函數并在關閉時撤消對該庫的初始化。如果對 COM 庫進行初始化或撤消初始化的嘗試失敗,就會出現這些錯誤消息。例如,Ole32.dll 文件可能已經損壞,或者其版本有誤。  

    LoadLibrary("Dllname") failed.GetlastError returns 0x00000485

    在 Winerror.h 中,0x00000485 = 1157 (ERROR_DLL_NOT_FOUND),表示“找不到運行該應用程序所需的某個庫文件”。例如,鍵入 regsvr32 missing.dll 后,如果找不到 Missing.dll 文件,就會返回該錯誤消息。  

    LoadLibrary("Dllname") failed.GetLastError returns 0x00000002

    在 Winerror.h 中,0x00000002 = 2 (ERROR_FILE_NOT_FOUND),表示“系統找不到指定的文件”。換言之,系統找不到相關的 DLL。例如,如果鍵入 regsvr32 icwdial.dll,而此時缺少 Tapi32.dll(依賴項),就會返回該錯誤消息。  

    LoadLibrary("dskmaint.dll") failed.GetLastError returns 0x000001f

    在 Winerror.h 中,0x000001f = 31 (ERROR_GEN_FAILURE),表示“附加到系統上的設備不能正常工作”。如果您嘗試注冊 Win16 .dll 文件,就會發生此現象。例如,鍵入 regsvr32 dskmaint.dll 會返回該錯誤消息。  

    DllRegisterServer (or DllUnregisterServer)in Dllname failed.返回代碼是:字符串

    在 Winerror.h 中搜索字符串。  
    Regsvr32.exe 和依賴項
    RegSvr32.exe 依賴于 Kernel32.dll、User32.dll 和 Ole32.dll 文件(在 Windows NT 中,還依賴于 Msvcrt.dll 和 Advapi32.dll 文件)。Regsvr32.exe 會加載您嘗試注冊或撤消注冊的文件及其所有依賴項。如果缺少必需的文件或者它們已損壞,該進程可能會失敗。  

    您可以使用 Depends.exe 來確定您嘗試注冊或撤消注冊的文件的依賴項。在 Microsoft Windows 98 資源工具包 和 Microsoft Windows NT 4.0 資源工具包 支持工具中都提供了 Depends.exe。
    247024 Tools Included with the Microsoft Windows 98 Resource Kit
    中國畜牧人網站微信公眾號

    評分

    參與人數 1論壇幣 +1 收起 理由
    畜牧刀客 + 1

    查看全部評分

    版權聲明:本文內容來源互聯網,僅供畜牧人網友學習,文章及圖片版權歸原作者所有,如果有侵犯到您的權利,請及時聯系我們刪除(010-82893169-805)。
    沙發
    發表于 2010-10-12 23:54:38 | 只看該作者
    收藏研讀。

    評分

    參與人數 1論壇幣 +10 收起 理由
    system + 10 第一個回復系統自動獎勵

    查看全部評分

    回復 支持 反對

    使用道具 舉報

    您需要登錄后才可以回帖 登錄 | 注冊

    本版積分規則

    發布主題 快速回復 返回列表 聯系我們

    關于社區|廣告合作|聯系我們|幫助中心|小黑屋|手機版| 京公網安備 11010802025824號

    北京宏牧偉業網絡科技有限公司 版權所有(京ICP備11016518號-1

    Powered by Discuz! X3.5  © 2001-2021 Comsenz Inc. GMT+8, 2025-9-18 00:56, 技術支持:溫州諸葛云網絡科技有限公司

    主站蜘蛛池模板: 青岛市| 鹤峰县| 商水县| 本溪| 福安市| 仁布县| 绵竹市| 鸡东县| 台州市| 南阳市| 咸宁市| 淮阳县| 全南县| 稻城县| 澄江县| 翼城县| 大邑县| 容城县| 敦化市| 西丰县| 宝应县| 施秉县| 商南县| 察哈| 绥江县| 阿巴嘎旗| 故城县| 南皮县| 天全县| 百色市| 鹿邑县| 容城县| 安仁县| 扶余县| 靖西县| 安康市| 辽宁省| 弥勒县| 广河县| 开化县| 惠水县|