I’m trying to use the TRACE macro to send the file name to the output window. The following compiles, but when it executes, instead of the desired output, I get an error in the output window:
TRACE(_T("Trace test.\r\n\tError: %d\r\n\tFile: %s\r\n\tLine: %d\r\n"), ERROR_SUCCESS, __FILE__, __LINE__);
Produces error:
_CrtDbgReport: String too long or IO ErrorFirst-chance exception at 0x7c812afb in MyApp.exe: Microsoft C++ exception: long at memory location 0x0012fe18..
I’m sure it has to do with the __FILE__ macro, but I’m not sure what exactly is wrong. Does anyone know how get this working? Thanks.
Isnt it that you need a wide string version of FILE to get that right ?