要註冊COM服務器,我們運行像在升高的模式:RegSvr32.exe的/ n和/ i參數有什麼不同?
regsvr32.exe com.dll
要執行每個用戶註冊,執行在用戶帳戶:
regsvr32.exe /n /i:user com.dll
regsvr32.exe的支持這些參數:
/u - Unregister server
/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
/s – Silent; display no message boxes (added with Windows XP and Windows Vista)
在Delphi中創建COM服務器時,這些方法被導出:
exports
DllGetClassObject,
DllCanUnloadNow,
DllRegisterServer,
DllUnregisterServer,
DllInstall;
我注意到這些會發生:
- 「Regsvr32.exe的com.dll」 援引中的DllRegisterServer。
- 「regsvr32.exe/u com.dll」調用DllUnregisterServer。
- 「regsvr32.exe/n/i:user com.dll」調用DllInstall。
- 「regsvr32.exe/u/n/i:user com.dll」調用DllInstall。
我很迷惑參數/ n和/我以及DllUnregisterServer和DllInstall。有什麼不同嗎?
另外,爲什麼「/ u/n/i:user」調用Dllinstall?我注意到「HKEY_CURRENT_USER \ Software \ Classes」中的相應註冊表項被刪除。
/n可*僅*與使用/ I,所以它不是 「之間」。 – 2012-06-12 03:42:36
使用「/ n/i」而沒有參數(DllRegisterServer)有什麼不同?何時使用「/ n/i」以及何時不使用任何參數? –
那麼,「什麼時候使用DllRegisterServer而不是(只)DllInstall」? – 2012-06-12 03:59:03