是否可以从 C++ DLL 接收 Stringlist?

Is it possible to receive a Stringlist from C++ DLL?

我需要从我的 C++ DLL 中获取字符串列表。我知道如何使用 DLL 并且已经在 [code] 部分用简单的数据类型做了几次,例如BooleanInteger。但是现在我需要获取一个字符串列表来以这种方式填充组合框,但我不知道从哪里开始。我读过如果我想获得 String 我需要在 Inno Setup 端分配内存。

所以我的问题是:

感谢您的帮助。

如果将其 HWND 传递给 DLL(使用 TWinControl.Handle),则可以在 C++ 代码中填充 Inno Setup 组合框。


如果您想将字符串列表从 DLL 传回 In​​no Setup,我建议您向 DLL 添加两个函数:

function GetComboBoxItemsCount: Integer;
procedure GetComboBoxItemString(Index: Integer; Str: PChar; MaxLength: Integer);

制作 GetComboBoxItemsCount return 项。然后在循环中调用 GetComboBoxItemString 以检索单个字符串。