News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Creating Error Constants

Started by 2-Bit Chip, August 20, 2009, 07:12:26 AM

Previous topic - Next topic

2-Bit Chip

Would there a special method to coming up with values for error constants?

ERROR_FILE_IS_GIGANTIC equ 34893
ERROR_FILE_DISAPPEARED equ 9325
ERROR_BAD_INPUT equ 834323589


EDIT: Ehh.. I'll just do 0 and on

OKAY equ 0
ERROR_... equ 1
ERROR_... equ 2

MichaelW

If it's OK for your user-define error codes to overlap the System Error Codes, then you could use any value. If not, then perhaps a reasonable approach would be to use negative values. Since the highest error code value currently defined is 15301, I doubt that there would be an overlap problem any time soon.

eschew obfuscation

dedndave

have a look in masm32\include\windows.inc and masm32\include\winextra.inc
most of them are already made for you