Re: Pointer Marshalling quesiton
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Fri, 21 Sep 2007 11:42:54 -0700
Well, I guess I'm out of practice on advanced IDL...
When I think about it, this is the same situation as with the
IEnumXXX family of interfaces.
One solution would be to use a [local]/[call_as] pair of
methods. Pass a stack variable to always receive the
interface pointer in your proxy shim and only return it to
the caller if it passed non-NULL pointer, otherwise release
it. I've posted local/call_as sample code in the past - you
may want to search the archives on Google groups.
The above solution is not very elegant I admit, since it still
involves interface pointer marshling. You may prefer to use
[wire_marshal] instead, though I have no direct experience
with that method of argument marshaling to advise you.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"jonathannah" <jonathannah@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:632242B4-6E79-474F-93EE-6EA0F5AEF4BB@xxxxxxxxxxxxxxxx
Refer to the original post. The parameter is [out] IUnknown** ppUnk.
Midl
will not allow you to specify unique or ptr modifier. it gives a compile
error.
error MIDL2121 : [out] only parameter must not derive from a top-level
[unique] or [ptr] pointer/array : [ Parameter 'ppUnk' of Procedure 'Bar'
"Alexander Nickolov" wrote:
Just add the [unique] attribute. The default is [ref]. Note it works
for [out] pointers too, not only [in, out]. [ptr] will do as well, but
it's heavier on the marshaling since it checks for pointer aliasing.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
.
- Follow-Ups:
- Re: Pointer Marshalling quesiton
- From: Alexander Nickolov
- Re: Pointer Marshalling quesiton
- References:
- Re: Pointer Marshalling quesiton
- From: Brian Muth
- Re: Pointer Marshalling quesiton
- From: Brian Muth
- Re: Pointer Marshalling quesiton
- From: Alexander Nickolov
- Re: Pointer Marshalling quesiton
- Prev by Date: Re: DCOM - How to configure the client?
- Next by Date: Re: Pointer Marshalling quesiton
- Previous by thread: Re: Pointer Marshalling quesiton
- Next by thread: Re: Pointer Marshalling quesiton
- Index(es):
Relevant Pages
|