Saving Local Variables to the INI File in a Mulit-DLL Solution

May I continue on this thread?
I have a multi-dll app.
→ many ReportProcedures.

All Procedures in the MainMenu APP allow for saving local variable of Windows the ini… like what TAB or Date of that Window was selected.

But the PrintWindowSelect.dll will not Save the local variables to the PrintWindowSelect.ini

If in PrintWindowSelect.dll the variable is a GLOBALvariable and added to the Global Preserve of that DLL, it is preserved in the MainMenu.INI

Any suggestions?

This is normal in a multi-DLL app.
During startup the EXE calls a procedure named :Init. It pass the GlobalErrors and INIMGR objects to the DLL. The DLL then uses these instead of local instances. That way the entire application uses the same error and INI class.

@CarlBarnes This should probably be it’s own question.


Yes, it is Globally declared by the Main.exe app.

You can not have a .ini file for each .dll file not designed that way. (as far as I know)

Been many years since I’ve regularly used ABC, but I think all you have to do is put the Lib of each DLL in the EXE’s project. The templates then generate the calls to YourDLL:Init()

What this does is replace each DLL’s global object with the one that originated in the EXE. Now all of the IniMgr and GlobalErrors are the same objects throughout all of the DLLs.

If you don’t call the DLL’s INIT() proc, then that DLL will have its own GlobalErrors and IniMgr.

Maybe it’s more than just putting the lib on the project. I think you have to add it as a module.

Yes, you add it as an external module.
From the Application menu

the pick the ExternalDLL module type:

1 Like

This is also necessary even if you don’t directly call any of the DLLs procedures from the EXE itself.

Also had to Set the INI file to USE to OTHER and leave Full file name: BLANK/EMPTY
In each of the DLL - Global Properties → General
[INI File Options]
Thank you Everyone!