Get ProjectName at compiletime
-
Hello, is there any possibility available to get the projectname during the compiletime? I need the projectname as string... Best regards Hansjörg
Can you more explain Im not sure you need to GetModuleBaseName or no?
-
Hello, is there any possibility available to get the projectname during the compiletime? I need the projectname as string... Best regards Hansjörg
- Get the value of project name from the project property if you are using VS2005, vsproperty->c/c++->preprocessor->preprocessor definitions: PROJECT_NAME=$(ProjectName) 2) Now use the PROJECT_NAME Macro from above in your code,
#define STRINGIZE(_x) #_x
#define STRINGIZEVALUE(_x) STRINGIZE(_x)char projectName[]= STRINGIZEVALUE(PROJECT_NAME);
-
- Get the value of project name from the project property if you are using VS2005, vsproperty->c/c++->preprocessor->preprocessor definitions: PROJECT_NAME=$(ProjectName) 2) Now use the PROJECT_NAME Macro from above in your code,
#define STRINGIZE(_x) #_x
#define STRINGIZEVALUE(_x) STRINGIZE(_x)char projectName[]= STRINGIZEVALUE(PROJECT_NAME);
Rajkumar R wrote:
#define STRINGIZE(_x) #_x #define STRINGIZEVALUE(_x) STRINGIZE(_x)
Clever. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke