庫函數(shù)接口注意
DLLs and libraries should handle all exceptions to prevent the display of errors and warnings through Windows dialogs.
-- From Delphi help: Creating packages and DLLs
DLL輸出函數(shù)拋異常通常會導致程序崩潰。
而且錯誤很難定位。
應用try/except包裹所有的輸出函數(shù)。
輸出函數(shù)的參數(shù)也要嚴格檢查。
(轉(zhuǎn)載請注明來源于金慶的專欄)