Cyllceaux wrote:My problem is, I have to "transport" the structures between DLLs an application.
I have my working*copys of structures and the original ones.
Maybe I make json from the structures and send only strings between the DLLs
Converting stuff to json and back is really slow.
Define the functions for structure allocation and copy in the main program and pass them to the dlls so every dll uses the same memory routines.
If u have many memory functions it might be handy to create an interface for that.
I have a big program. (more than 300k lines of code) Everything in one execution file. I make it smaller with export lots of function to DLLs.
I have a DLL for my database. My Customers have some kind of JSON Database.
So I load and save everything in json. The program works on medical datas… A LOT OF Medical datas in different parts of the json structures.
For example, I have some DLL to "clean" chromatography-datas, some of enrich the the datas with massspectrometry- datas (maldi) and parts of personal datas. The json files are compressed and secured. I only work with parts of the datas… not the complete bunch. If I finish my work, I update the single parts of the datatree (the reason of *original and *copy) and save them again.
The next I want to extract these to DLLs, I have some branches of the software. (I use fossil) with some new UI and so on... And I don't want to copy alle these code everytime in every Branche, when I can use a dll.
My english is not very good so i dont really get what you want to do
But i can think of another possible solution involving some black magic (hack).
-> You could probably also patch the memory heap of the dll so all code works on the same memory heap.
That's right, CopyStructure() internally free previous structure elements, so it can't work that way (needs to be in the DLL as well, as it has its own memory space).