Click to See Complete Forum and Search --> : Dual Interface & BSTR


reverse
April 23rd, 1999, 08:28 AM
When make a IDL for dual interface, we must choose parameter's type from only VARIANT and BSTR.
Using other type, VC++ compiler warns me of in-compatiablity with Dual Interface.

So, I have used only VARIANT and BSTR as a parameter's type of dual interface.
But, I needed to use a reference of BSTR.
I wrote IDL as follows.

[id(1), helpstring("method Parse")] HRESULT Parse([in] BSTR args, [out] BSTR* htmlResult, [out, retval] short* result);

It was successfully compiled and runned well in VB.
But, in ASP, it occurred type mismatch error at "htmlResult" parameter.
Besides, I don't know if its VC++ client would release the memory of htmlResult using SysFreeString.

Let me see wise answers of above two stupid question.

Regards

A programmer who loves Goethe.

chris law
April 23rd, 1999, 10:03 AM
Only automation types in dual interfaces because must be able to call through invoke.
argument: client allocate, server release memory
[out] argument: server allocate, client release
[in, out] argument: client allocate and release

I don't know why reference with html does not work
bstr is (I think) LPOLESTR (this *is* a reference, or not?)

sorry cannot tell you more

[i]chrislaw