OWLNext 7.0
Borland's Object Windows Library for the modern age
|
The TSocketError class stores an error numerical value and a string describing the error. It automatically fills in the string part of the error if you give it the numerical error value. This class can be used to help make error strings to report to the user, and to store errors for later use. Every error index defined in Winsock can be reported here. With the TSocketError class you can use strings from the string table resource, or you can use static strings that are already stored directly in the source code for the class. The choice between the two is made with a compilation switch:
The advantage of static strings in the source code is that they are already done and you don't have to deal with the string table resource. The disadvantage is that static strings are harder to maintain and take up space in your program's data segment. It may be best to use static strings for pre-release work work prototyping, and use string tables for the final product.
This class does not have a function here to actually print the string to the screen in, say, a MessageBox(). This was done to make the TSocketError base class more portable. You can subclass the TSocketError class with, for example, "WinSocketError : public TSocketError" and add one function: "ReportError()."