O
O
Oleg Matrozov2011-06-20 09:23:57
Delphi
Oleg Matrozov, 2011-06-20 09:23:57

[SOLVED] Passing control over data block from dll to application?

There is a dll which is dynamically linked to the program. In the dll itself, a block of memory is allocated and a pointer to this block is passed to the program. The problem is that if you unload the dll after that, then the memory block will be freed. Is it possible somehow to transfer a block of memory from a dll to a program so that this block is not deleted when the dll is unloaded? Or is it possible to somehow create a block from the code located in the dll in the memory area of ​​the main program?
PS I write under Delphi, I don't know if there is a similar "problem" in other languages.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lifelover, 2011-06-20
@Mear

You can pass a pointer to the allocator from the main program to the dll.
Or allocate memory in the system heap (HeapAlloc and HeapFree).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question