|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Dee Holtsclaw (dee
SUNBELTSOFT.COM)Date: Tue Oct 30 2001 - 08:23:00 CST
I'm looking for a solution to problems with my IMoniker implementation.
Looking at the 'mkbase.h' implementation from Tim Ewald, Chris Sells and Don
Box (inline), this implementation does not take into account 'ppmkToLeft'
being NULL. When it is, the ROT will reject a registration since Reduce
returns E_POINTER. In addition to this, the IRotView viewer hangs if you
zero out the interface pointer it passes in *ppmkToLeft. The viewer also
adds an unreleased reference each time it's refreshed. This leads me to
believe there's a problem with the Reduce method (or the IRotView utility is
munged).
My own moniker class is a root level object and self-contained. At the
present time, there are no monikers which can be legitamitely composed to
the left or right of mine. I can successfully place the moniker into the ROT
and retrieve it in another process -- once. Subsequent attempts to get the
object from the ROT return MK_E_UNAVAILABLE yet it remains visible in the
IRotView until released.
Any assistance would be greatly appreciated -- I really need to keep what
hair I still have...
TIA
Ciao,
Lawrence "Dee" Holtsclaw
Yes, this is cross-posted -- SIA (Sorry in advance)
<MKBASE CODE>
inline
STDMETHODIMP CComMonikerRootBase::Reduce(
IBindCtx* pbc,
DWORD dwReduceHowFar,
IMoniker** ppmkToLeft,
IMoniker** ppmkReduced)
{
HRESULT hr = E_POINTER;
if( ppmkReduced && ppmkToLeft )
{
*ppmkToLeft = 0;
(*ppmkReduced = this)->AddRef();
hr = MK_S_REDUCED_TO_SELF;
}
return hr;
}
</MKBASE CODE>
<MY REDUCE CODE>
STDMETHODIMP CTMoniker::Reduce(IBindCtx *pbc, DWORD dwReduceHowFar, IMoniker
**ppmkToLeft, IMoniker **ppmkReduced)
{
ATLTRACE("CTMoniker::Reduce(%p,0x%x,%p(=%p),%p(=%p))\n",
pbc, dwReduceHowFar, ppmkToLeft, ppmkToLeft ? *ppmkToLeft : NULL,
ppmkReduced, ppmkReduced ? *ppmkReduced : NULL);
if(!ppmkReduced)
return E_POINTER;
// if(ppmkToLeft){
// if(*ppmkToLeft)
// (*ppmkToLeft)->Release();
// *ppmkToLeft = NULL;
// }
(*ppmkReduced = this)->AddRef();
return MK_S_REDUCED_TO_SELF;
}
</MY REDUCE CODE>
----------------------------------------------------------------
Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]