• Advertisement

Archived

This topic is now archived and is closed to further replies.

FormatMessage gives crap!

This topic is 5714 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is what I get when I display cErrMsg: = What´s wrong?
  
char	cErrMsg[256];
LPVOID	lpMsgBuf[256];

FormatMessage( 
FORMAT_MESSAGE_ALLOCATE_BUFFER | 
FORMAT_MESSAGE_FROM_SYSTEM | 
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language

(LPTSTR) &lpMsgBuf,
0,
NULL 
);

strncpy(cErrMsg, reinterpret_cast<char *>(lpMsgBuf), 256);
  

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement