I want to make an interface, but I don't know something.
Is OleVariant
a "standard" for containing "standard" string - to pass and return?
function Any(Input : OleVariant; out Output : OleVariant) : integer; stdcall;
The another side is maybe .NET, C#, or C++ or Delphi.
So can they back some "string" result in OleVariant
without I pass a predefined sized buffer for result?
Yes, OleVariant
is perfectly safe. You'll see it used throughout the COM-related units distributed with Delphi, such as ActiveX, ComSvcs, and MSXML. Standard Windows API units use it, so you can, too.
If you're always expecting a string, though, then you should prefer WideString
instead. It's equivalent to the Windows BSTR
type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With