How do I read from a version resource in Visual C++

前端 未结 7 437
情歌与酒
情歌与酒 2020-11-28 09:17

I have a version resource in my resources in a C++ project which contains version number, copyright and build details. Is there an easy way to access this at run-time to po

7条回答
  •  醉酒成梦
    2020-11-28 09:57

    Beware! Using FindResource..LockResource is not correct. It will sometimes work (as it did in my small demo program) and sometimes cause access violations (example: the production code I was making the demo for).

    The VerQueryValue() documentation states that you should call GetFileVersionInfoSize and GetFileVersionInfo instead. Raymond Chen explains, see http://blogs.msdn.com/oldnewthing/archive/2006/12/26/1365215.aspx

提交回复
热议问题