输出函数不应抛异常

来源:互联网 发布:js动态添加样式 编辑:程序博客网 时间:2024/06/01 08:28
库函数接口注意

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输出函数抛异常通常会导致程序崩溃。
而且错误很难定位。

应用try/except包裹所有的输出函数。
输出函数的参数也要严格检查。
 
(转载请注明来源于金庆的专栏)
原创粉丝点击