alogrep 0 Posted December 6 HI I hope someone can help. The docwiki states: EnumModules continues until the last module in the application is enumerated, or until the callback function returns False. Bu the code below omnly shws the Application name,. Where is my error? function GetModules(Instance: THandle; Data: Pointer): Boolean; var FileName: array[0..Max_Path] of Char; begin if GetModuleFileName(Instance, FileName, SizeOf(FileName)) > 0 then Tlistbox(Data).items.Add(FileName) else RaiseLastWin32Error; Result := True; end; EnumModules(GetModules, ListBox1); Share this post Link to post
Remy Lebeau 1429 Posted December 6 (edited) 16 minutes ago, alogrep said: Bu the code below omnly shws the Application name,. Where is my error? Does your program use external DLLs/BPL files? Even if you are using Packages, if they are statically linked into your EXE then they will probably not be treated as separate modules. Edited December 6 by Remy Lebeau Share this post Link to post
alogrep 0 Posted December 6 Thanks Remy. I am talking aboutn the Component ->Install Packages list. Is there a way to get a list of them to print or to save to a file? Share this post Link to post
PeterBelow 239 Posted December 6 Have you enabled "Build with run-time packages" in the project options? If not all code from the units in question will be compiled into a monolithic exe and there will be no other modules other than DLLs used from the OS or statically linked by units used in the application. Share this post Link to post
Remy Lebeau 1429 Posted December 6 (edited) 4 hours ago, alogrep said: I am talking aboutn the Component ->Install Packages list. What makes you think EnumModules() has anything to do with that list? It enumerate the modules that your compiled EXE is using at runtime. Not the modules that are installed in the IDE at design-time. Quote Is there a way to get a list of them to print or to save to a file? If you want the list that is installed in the IDE, then you will have to manually read that list from the IDE's configuration in the Windows Registry. If you want the list that your EXE is compiled with, then such modules only exist if you compile with Runtime Packages enabled so the packages are used as external BPLs at runtime. Edited December 6 by Remy Lebeau 1 Share this post Link to post