开发者

What's the best way of getting the results of GetLastError() after a WinAPI call into a nice char*?

I'm writing a DLL which a java program uses to call the WinAPI in various ways.开发者_如何学C I want to throw proper exceptions back to java but I need a nicely formated WinAPI error not just the int that get's returned from GetLastError(). I'm sure there's a nice way to do it.


Use "FormatMessage"; you can pass in the error code as the 3rd parameter, and even have FormatMessage allocate the space for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜