Re: use customized data type in IDispatch.Invoke
"George" <George@discussions.microsoft.com> wrote in message
news:F5D77617-C313-4D72-9A66-E5EC5830A1ED@microsoft.com
I think we always use pass struct pointer or BSTR pointer through
function parameter or return values of interface, correct? (I mean
there is no way and not correct to access them directly, e.g. through
global pointer table, since I think marshal pointer or through global
pointer table are for interface pointer, not for BSTR or struct
pointers?)
I don't understand this question.
If yes to 1, my confusion is, the purpose of passing by pointer is we
want the destination apartment to be able to modify the data passed
by pointer.
Not necessarily. [in] BSTR parameters are routinely used. BSTR is a
pointer, but the callee is not expected to modify the pointed-to data.
But you mentioned if we pass pointer of parameters/return
values, marshaler will make a copy, then how does the purpose of --
"want the destination apartment to be able to modify the data passed
by pointer" be achieved by underlying technologies
If the parameter is [out] or [in, out], and thus the callee is in fact
expected to modify the data, the marshaller would copy the modified data
back over to the caller's apartment.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925