A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.
I've recently had to start making some DLLs to encapsulate functionality for a huge project at work. These DLLs need to be loaded into various runtimes (Borland C++, Microsoft C++, Microsoft Visual Basic, etc.) so the exported functions are written in C and use SetLastError() to return error codes. In addition, I'm using the Message Compiler to generate textual descriptions of the errors
that will be embedded in the DLLs.
Now, take a quick look at the MSDN documentation on error codes.
Does anybody actually make use of this? System error codes don't follow this specification (backward compatibility with MS-DOS), and most non-Microsoft DLLs simply set the customer bit and start error numbers at 1 (ie 0x20000001). These fields might be useful for event logging, but the parameters to the ReportEvent() function clearly override anything in the bit-fields of the event identifier, although you could use macros to pull out the bit fields to pass as parameters.
Should I bother following this specification?
Wednesday, July 13, 2005
This topic is archived. No further replies will be accepted.Other recent topics
Powered by FogBugz