In my Delphi Hydra host application, I want to list all the loaded modules. I put them into a TStringList like this:
for i := 0 to HYModuleManager.ModuleCount - 1 do
ModuleList.Add(ExtractFileName(HYModuleManager.Modules[i].FileName));
When I displayed the strings, the list was empty. Stepping through, I noticed the FileName property was blank but the fFileName field had the filename value I was after. Looking through the source, I found that THYModule has a private fFileName field but its ancestor class, THYBaseModule, has a protected fFileName field which is where the FileName property reads its value.
Since THYModule.fFileName is private, I can’t display it from my application. Of course, I can manually build my own list while I’m loading the plugins, but would like to use the list in the module manager that is already there.
I thought I had used this technique in the past. Has it been changed, or am I using it wrong somehow?
Using Delphi 10 Seattle with Hydra 4.0.79.1119
Thanks,
David.