Re: MBV question #324: how to pass a MBV object in a VARIANT?
While I admit I haven't experimented myself, I'm not sure
what you are saying is correct. Custom marshaling is handled
on per object basis so the decision whether to use it happens
when the first interface is marshaled and IUnknown (or rather
its wire equivalent IRemUnknown) shouldn't be an exception.
I believe marshaling IUnknown does kick-off custom marshaling.
What I expect doesn't get involved in case of standard marshaling
for an initial IUnknown is IStdMarshalInfo.
Microsoft MVP [VC], MCSD
MVP VC FAQ: http://vcfaq.mvps.org
"Igor Tandetnik" <email@example.com> wrote in message
Jason S <firstname.lastname@example.org> wrote:
ok, suppose I have a marshal-by-value object that implements IMarshal.
Let's say I want to stuff it into the IUnknown * field of a VARIANT
for an [out,retval] parameter.
How does COM figure out how to marshal the variant? is it supposed to
call my object's IMarshal::GetUnmarshalClass method? (because that
doesn't seem to be happening and I'm confused :/ )
MVB will kick in when the client queries for any interface other than
IUnknown. If you want it to happen earlier, pack an IDispatch* into a
variant of type VT_DISPATCH.
With best wishes,
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