I need to get a list of string from my C++ DLL. I know how to use the DLL and already do it several times in the [code]
section with simple data types e.g. Boolean
or Integer
. However now I need to get a list of string to fill a combo box this way, but I've no idea where I could start. I've read that if I want to get a String
I need to allocate memory on Inno Setup side.
So my questions are:
Thanks for help.
You can populate the Inno Setup combo box in your C++ code, if you pass its HWND to the DLL (use TWinControl.Handle
).
If you want to pass a list of strings from DLL back to the Inno Setup, I'd suggest you to add two functions to the DLL:
function GetComboBoxItemsCount: Integer;
procedure GetComboBoxItemString(Index: Integer; Str: PChar; MaxLength: Integer);
Make GetComboBoxItemsCount
return number of items. And then call GetComboBoxItemString
in a loop to retrieve individual strings.