VERSIONINFO in program
-
Hey all. I noticed the VS_VERSION_INFO resource that is inside my program that I am building. I am building code that displays the current version in various places. I would like to be able to pull the values from this VS_VERSION_INFO resource, instead of having to declare a version-info variable in my class -- which just makes more places for me to update it. I checked MSDN about this and all that I can come up with is GetFileVersionInfo() method. I do not want to have to use a method if I don't have to that acutally looks at its own .EXE to determine the current version. I am wondering if there is another method or some other way to grab those values from the resource at compile time? Thanks!
-
Hey all. I noticed the VS_VERSION_INFO resource that is inside my program that I am building. I am building code that displays the current version in various places. I would like to be able to pull the values from this VS_VERSION_INFO resource, instead of having to declare a version-info variable in my class -- which just makes more places for me to update it. I checked MSDN about this and all that I can come up with is GetFileVersionInfo() method. I do not want to have to use a method if I don't have to that acutally looks at its own .EXE to determine the current version. I am wondering if there is another method or some other way to grab those values from the resource at compile time? Thanks!
Hi, Search google for a class 'CModuleVersion' which can be used as TCHAR szPath[MAX_PATH]; GetModuleFileName(NULL,szPath,MAX_PATH); CModuleVersion ver; if(ver.GetFileVersionInfo( szPath , TRUE)){ CString s; s.Format(IDS_STRING61504,HIWORD(ver.dwFileVersionMS), LOWORD(ver.dwFileVersionMS), HIWORD(ver.dwFileVersionLS)); SetDlgItemText(IDC_VERSION , s );//UnicodeConversion } Hari Krishnan