Why is FormatMessage() failing to find a message for WinINet errors?
问题 I'm running this to test FormatMessage: LPVOID lpMsgBuf; errCode=12163; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM , 0, errCode, 0, (LPTSTR) &lpMsgBuf, 0, NULL ); However, when it returns lpMsgBuf contains NULL... I was expecting something like ERROR_INTERNET_DISCONNECTED. Anything look wrong? Thanks. 回答1: That's a WinINet error, and so the message associated with it lives in WinINet.dll. You just need to tell FormatMessage() about this in order for it to