__FILE__ macro
-
I am using __FILE__ macro in my application. In the debug version it returns the absolute path of the source file but in the release version it return path relative to project directory. Is this normal behaivour or am I missing something. thanks, -Saurabh
-
I am using __FILE__ macro in my application. In the debug version it returns the absolute path of the source file but in the release version it return path relative to project directory. Is this normal behaivour or am I missing something. thanks, -Saurabh
HI; Look at the code of follow //----------------------------------- #ifdef _DEBUG//<-----------------NO 1 #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif //----------------------------------- so In the debug mode you can capture the absolute path and In the release mode u capture the project directory instead of absolute path chuanke -- modified at 1:07 Friday 6th January, 2006
-
HI; Look at the code of follow //----------------------------------- #ifdef _DEBUG//<-----------------NO 1 #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif //----------------------------------- so In the debug mode you can capture the absolute path and In the release mode u capture the project directory instead of absolute path chuanke -- modified at 1:07 Friday 6th January, 2006
sorry I forget to mention that this is not a MFC application. I am trying to do this in a console application. anyway I found the solution here[^]. It says use /FC (Full Path of Source Code File in Diagnostics) to get absolute paths using __FILE__. It seems somwhow MFC do that for you in debug but not in release build, although I don't see this switch enabled in the settings. -Saurabh -- modified at 2:45 Friday 6th January, 2006