LinMinquan's Blog

Experience technology to change life

GetLastError()的使用

有次用到CreateBitmap()函数时,返回的HBITMAP一直没有值,不知道问题出在哪,请同事帮忙时,他用到了GetLastError(),紧接着写在CreateBitmap()的后面,拿到的返回值是87,搜了下是参数错误。后来针对地调整了下参数,就可以了。

搜索了下其用法,发现还有FormatMessage()可以配套使用,下面这篇文章写得挺好的。

GetLastError()和FormatMessage() 


Share