Converting FOUR_CHAR_CODE / FOURCC to string
-
I have an error handler that deals with FOUR_CHAR_CODE('xxxx') type of errors from a library. The lib doesn't have any string definitions for the codes but I want to present something of the error in an arror message to aid tracking down errors.
Are there any standard macros to convert a four cc back to a string as I'm thinking the endianness may be platform specifi?. I can only find MAKEFOURCC in mmsystem.h to go from chars to fourcc.
-
[quote user="danio"]I have an error handler that deals with FOUR_CHAR_CODE('xxxx') type of errors from a library. The lib doesn't have any string definitions for the codes but I want to present something of the error in an arror message to aid tracking down errors.
Are there any standard macros to convert a four cc back to a string as I'm thinking the endianness may be platform specifi?. I can only find MAKEFOURCC in mmsystem.h to go from chars to fourcc.
[/quote]Wow... I just spent like 5 minutes going over the basics of FOURCCs because I thought you were asking something different lol... I left it below for others if they want to read.
My advice: ignore endianess and just shift the damn bits. If you are only using it for an error message, then you'll know if endianess matters when someone gets an error message from a machine where the endianness is different than what you are using.