Thanks for your code Trond.
I tried to use it with linux, but got a linker error:
Code: Select all
...: undefined reference to '_PB_StringHeap' ...
So I assume this not applicable to linux in that way.
As I see it, new Windows versions may break your old code anyways.
You can only guess, how the conditions may be in the future.
When you know, how the conditions factually are,
you can adapt to them in a workable way (if at all possible).
I admit, that you should prepare for probable possibilities,
but this is also a matter of what your choices are
and how expensive each one is...
The only real alternative, I see (except for not having the procedure in a different library at all ...),
is something like Demivec suggested or maybe letting the caller create a buffer,
that the called procedure then can fill.
All the "alternatives", I could think of as yet, look kind of disadvantageous and clumbsy to me.
Besides, I'm using the linux version most of the time.
The code can and will be changed, as long as it is used,
if something is not good enough it will be made better (if possible).