Jump to content
  • Advertisement
Sign in to follow this  
Kris_A

Winsock error - message lib\header?

This topic is 4842 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

Hiya, I'm looking for a simple way to convert Winsock "WSAGetLastError()" messages to strings. Does anyone know of a C/C++ header or function that can be used to do this (either a Windows header or a 3rd party one)? Thanks. Just to verify, I need something like:
  char * ErrorMessage(int error_code);
or even:
  char * error_array[] = {...
Cheers! Edit: can anyone tell me why my rating dropped 50+ points after disagreeing with an "elite" member (whos opinion is obviously worth more than mine)? Is that not allowed here?

Share this post


Link to post
Share on other sites
Advertisement
You can simply use FormatMessage:


char buffer [1024];
int bufsize = sizeof (buffer);
FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, error_code, 0, buffer, bufsize, NULL);



As for your rating. It can drop for no apparent reason whatsoever. Perhaps you were disrespectful or rude, perhaps extremely obtuse. Maybe the person rating you was just having a bad day. I've seen my rating drop with some of what I considered my most helpful posts.

Share this post


Link to post
Share on other sites
Perfect [grin] Thanks a lot.

Quote:
As for your rating. It can drop for no apparent reason whatsoever. Perhaps you were disrespectful or rude, perhaps extremely obtuse. Maybe the person rating you was just having a bad day. I've seen my rating drop with some of what I considered my most helpful posts.

I see :/ I probably came off as being pretty rude. It's just annoying when you're trying to help and someone comes along and tells you that how you choose to do things is 'wrong'.

Share this post


Link to post
Share on other sites
Please don't post about ratings in this forum; it's highly off-topic. I suggest the lounge -- or just live with it as it is; your contributions over time are likely to speak much louder than any random variations in rating.

Share this post


Link to post
Share on other sites

This topic is 4842 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.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!