From: Giovanni Dicanio on
"Scott Ballard" <scott.ballard(a)gmail.com> ha scritto nel messaggio
news:7e021c23-b175-4082-ada4-0f5e0ae88805(a)h27g2000yqm.googlegroups.com...

> [...] a COM interface that defines
> the method like this in the IDL:
>
> HRESULT Foo([in] BSTR incoming, [out] BSTR* outgoing);
>
> In C# the interface is defined like this:
>
> void Foo([In, MarshalAs(UnmanagedType.BStr) string incoming,
> [MarshalAs(UnmanagedType.BStr] out string outgoing);

I would try using an IntPtr on the C# side and build the BSTR manually e.g.
P/Invoking SysAllocStringByteLen.

Giovanni