I have just seen the other ImGui::ListBox implementation that uses a label getter function for each list item. I think it is the key to not get lost on char* arrays allocations by using engines native methods. It allows to a 3dgs user the use of TEXT structs to hold arrays of char arrays. It can use any custom data struct at the end.

// C++
DLLFUNC var imgui_h_list_box (const char* label, int* current_item, bool(*items_getter)(void*, int, const char**), void* data, int items_count, int height_in_items) {
	bool res = ImGui::ListBox(label, current_item, items_getter, data, items_count, height_in_items);
	return res ? _VAR(1) : _VAR(0);

// liteC
var imgui_h_list_box (char* label, int* current_item, void *items_getter, void* data, int items_count, int height_in_items);
TEXT *txtList = {
	string = (
		"eoeoeo 1"
		"eoeoeo 2"
		"eoeoeo 3"
		"eoeoeo 4"
		"eoeoeo 5"
		"eoeoeo 6"

BOOL _label_for_text(TEXT *_txt, int _index, char **_label) {
	*_label = (_txt->pstring)[_index]->chars;
	return TRUE;

static int _currentItem = -1;
imgui_h_list_box ("##TEXT list box", &_currentItem, _label_for_text, txtList, (int)txtList->strings, 10);


I have got another newby question related to the memory and dynamic libraries. As far as I read last days the executable binary and the dinamic library use two different memory areas. I read that the main law is that the allocator have to be the releaser. In the case of using the engine functions into a dll, the allocated memory shall be into the memory asigned to the engines dll, so it is managed same as it would be allocated in liteC, isn't it?

I did some test and I do not receive any errors, so, my question is: Is it safe to add newly created STRINGs into a dll to a TEXT struct passed from liteC and realease them all in liteC?