Why can Delphi DLLs use WideString without using ShareMem?
A WideString is the same as a BSTR, it’s just the Delphi name for it. The memory allocation is handled by the shared COM allocator, CoTaskMemAlloc. Because all parties use the same allocator you can safely allocate in one module and deallocate in another. So, the reason you don’t need to use Sharemem is that … Read more