Click here to Skip to main content
15,911,306 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have a query. I am using winsock functions in my project. Most of the winsock function calls return more than one possible error codes. I want to send all possible error codes to the caller in order to display the appropriate error message to the user.

So please suggest a better way to return multiple error codes here?

Thanks in advance !
Posted
Updated 19-May-11 22:07pm
v2

There is a list of Windows Sockets Error Codes here[^] why don't you use it (or, better, the one in your current Winerror.h file)?
 
Share this answer
 
v2
i think you can use pointer array to return Multiple error codes. If you can post your code here we can help you in much better way.
 
Share this answer
 
There's a number of ways to accomplish this:

1. Return structure (to return multiples, they can be a linked list).
2. Return array.
3. Return simple error code and use a GetErrors() or GetLastError() type of routine to get details.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900