How do I determine the Version number of a DLL? lazarus / 34-Windows ---------------------------------------------------------------------- RedOctober · 2021-12-24 20:05 Platform:  OS: Windows Server 2016    Lazarus 2.0.10   FPC   3.2.0 I'm working with several different versions of a DLL.  The file name is always the same.  I have a Windows app, with a main form, and I'd like to display the version number of the DLL in use, on the main form, in a Label.  I cannot find a function that can extract this information. Does anyone know of a function or code snippet that can accomplish this?  Thanks in advance. ---------------------------------------------------------------------- MarkMLl · 2021-12-24 20:54 In the general case, can't be done. It would have to rely on the DLL author exporting a function (etc.) which declared the version number. I've done quite a lot of custom hacking based on a DLL (or on Linux, shared object) exporting a magic number which defined the programming interface, but that relies on having full control of both the DLL and the program that's using it. MarkMLl ---------------------------------------------------------------------- trev · 2021-12-24 21:39 See the Forum thread FileVersionInfo did not work with a DLL for the solution. ---------------------------------------------------------------------- RedOctober · 2021-12-25 00:11 Hi MarkMLI and Trev.  Thanks to your help, I was able to modify the code shown in the other examples, to determine the version of a single DLL, which is what I need. The code below works. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  uses  FileUtil, fileinfo, winpeimagereader; ... type  TDllInfo = class(TObject)    FileName : String;    ModulName : String;    Info : string;  end;  ...  function GetDLLVer(const dll_fnm: String): String; ... implementation  ...  function GetDLLVer(const dll_fnm: String): String;var  i: Integer;  FileVerInfo:TFileVersionInfo;  FileName, ModulName: String;  aDllInfo : TDllInfo;begin  FileVerInfo := nil;  try    FileVerInfo:= TFileVersionInfo.Create(nil);    FileVerInfo.FileName:= dll_fnm;    try      FileVerInfo.ReadFileInfo;      ModulName:= FileVerInfo.VersionStrings.Values['InternalName'];    if ModulName <> '' then begin        aDllInfo := TDllInfo.Create;      aDllInfo.FileName:= dll_fnm;        aDllInfo.ModulName:= ModulName;        aDllInfo.Info := FileVerInfo.VersionStrings.Values['FileVersion'];        Result := aDllInfo.Info;      end;    finally      ; // nothing to do    end;  finally    FileVerInfo.Free;  end;end;