Re: File Version without GetFileVersionInfo



Joseph M. Newcomer wrote:
It is a bit more complex than that, and his concern was "going to the file system", which,
guess what, FindResource must do anyway! So his concern is pointless, and shows he is not
thinking clearly about how to solve a trivial problem in a trivial way using a trivial
method, but wants to "improve" on it by somehow bypassing the documented, working
mechanism to implement some ad-hoc mechanism that could break on the next release of the
OS, because of a peculiar idea that "going to the file system" somehow is a Bad Thing.

I always worry about how poorly we are training people when they even consider such issues
worthy of discussion.

I think tnewton really stumbled on something here because it *is* possible to rename currently loaded dll, and place another with the previous name. In this situation GetFileVersionInfo will return invalid data (if the old dll is still loaded).


This could be an issue if you want to update dll on the fly, and you have only restart mechanism available, but not stop/start mechanism. In this case updating must be done with "rename and copy another" routine. In all the other cases the "prize" isn't worth the effort.
.




Relevant Pages

  • Re: File Version without GetFileVersionInfo
    ... Note that if the resources are in use, it is normally impossible to replace a DLL. ... >possible to rename currently loaded dll, ... >this case updating must be done with "rename and copy another" routine. ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: Riched20.dll
    ... It can come from a folder ... you may have on the system called ServicePackFiles. ... Rename in ServicePackFiles ... > dll and paste the new one, the current dll after the rename is back. ...
    (microsoft.public.windowsxp.general)
  • Re: Renaming DLLs?
    ... The application still looks for the original filename. ... Yes, you can rename ... a dll, though obviously, the app that uses it has to know about the ... This is taken from a larger script I use with some apps that lets ...
    (comp.os.os2.programmer.misc)
  • Re: Telling if a DLL is in use
    ... First make a copy of the .dll, then rename the original to something-else, ... Deleting the file before attempting to delete it may seem to violate your ... then your detection routine works properly, ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Deploying/Development without Visual Studio
    ... So should I use those under Platform Builder 4.2 or use the ones ... > from the CF Framework cab files? ... To rename .cab CF dll you can load thi files into Reflector and it will ...
    (microsoft.public.dotnet.framework.compactframework)

Loading