第一章 错误处理
1、$err, hr 在vs的watch窗口中监视这个可以获得刚执行的windows api 的错误代码及详细解释。
2﹑自定义消息码:
(从左到右)
第31~30 位(Severity)
0=Success
1 = Informational
2 = Warning
3 = Error
第29 位(Microsoft/customer)
(注意第29位,自定义的消息码必须为1)
0 = Microsoft-defined code
1 = customer-defined code
第28 位(Reserved)
Must be 0
第27~26 位(Facility code)
The first 256 values are reserved by Microsoft
第15~0 位(Exception code)
Microsoft/customer-defined code
3、FormatMessage函数可以把消息码格式化成其对应的字符串。
4,GetLastError()函数的应用