READ FROM RESOURCE FILE
-
Hi, I want to read version number and company name from RC File at run time. How can i do this ? Thanks in advance
If you mean "read version information from the resources of a module at runtime", then you can use GetFileVersionInfo (...). You can even use it on the calling module by using GetModuleFilename to get the path to use. There is even an article "ShowVer.exe command-line VERSIONINFO display program"[^] with example code. If you really mean from an .RC file, then just read it as text and parse it.
-
If you mean "read version information from the resources of a module at runtime", then you can use GetFileVersionInfo (...). You can even use it on the calling module by using GetModuleFilename to get the path to use. There is even an article "ShowVer.exe command-line VERSIONINFO display program"[^] with example code. If you really mean from an .RC file, then just read it as text and parse it.
another way is to load the resource section by calling findresource and loadresource. Don't try it, just do it! ;-)