FOURCC to string?
I'm trying to interpret a Four Character Code (FOURCC) as a string. FOURCCs are longs representing characters which make up an identifier for multimedia content in AVI files, among others. So, does anyone know a way of converting a long into a char?
Well, I was once working on AVI files, so I think I can help you.
I have four solutions for you:
- read it as a char, that was what I was doing.
- handle it as a DWORD, make constant values using MAKEDWORD and MAKEWORD
- do the following:
store your DWORD into dwValue, and then read it from cValue as you would on a normal struct, but it's a union, so both members share the same memory position.
- make a funtion:
int DwordToFourCC(DWORD fcc, char* buffer)
//I'm not sure about the order of these, but try messing with them
I haven't tried each one of these, so I'm not sure they would work...
I can only say that these could work on Visual C++ 6, I'm not sure about other compilers
Good Luck :)