如果uninstall.vsf文件在此代碼中調用LoadVCLStyle_UnInstall
函數時不存在,我該如何忽略msgbox的錯誤?忽略錯誤處理的錯誤信息?
我假設使用嘗試塊用空除了將足以在其他語言,但事實並非如此。
// Import the LoadVCLStyle function from VclStylesInno.DLL
procedure LoadVCLStyle_UnInstall(VClStyleFile: String); external '[email protected]{app}\uninstall.dll stdcall uninstallonly';
//E: Occurs when the uninstaller initializes.
function InitializeUninstall: Boolean;
begin
Result := True;
// Initialize the VCL skin style.
try
LoadVCLStyle_UnInstall(ExpandConstant('{app}\uninstall.vsf'));
except
finally
end;
end;
你所看到的並不是一個例外,而是一個消息框['由'顯示](https://code.google.com/p/vcl-styles-plugins/source/browse/trunk/InnoSetup%20plugin/ VclStylesInno.dpr#61)當引發異常時插件。這種情況下,您可以通過在嘗試加載皮膚之前檢查是否存在'FileExists'來解決這個問題;與其他任何異常,你都很不幸。 DLLs不能引發任何異常,但是當它們遇到一些IMHO時不應該顯示任何對話框。像GetLastError這樣的系統在那裏會更好。 – TLama 2014-11-23 11:08:15