I was looking for a way to stuff some data into a string across a DLL boundary. Because we use different compilers, all our dll interfaces are simple char*.
Is ther
I'd not construct a std::string
and ship a pointer to the internal buffers across dll boundaries. Instead I would use either a simple char
buffer (statically or dynamically allocated). After the call to the dll returns, I'd let a std::string
take over the result. It just feels intuitively wrong to let callees write in an internal class buffer.