TheSwamp

Code Red => ARX Programming => Topic started by: ahlzl on December 03, 2009, 06:51:57 AM

Title: about new IUnknown question
Post by: ahlzl on December 03, 2009, 06:51:57 AM
Hello:
in ARX2008 SDK\samples\simpledynprops\enumproperty.cpp, have this code:
Code: [Select]
STDMETHODIMP CEnumProperty::SetCurrentValueData( /*[in]*/LONG_PTR objectID,
                                     /*[in]*/const VARIANT varData)
in ARX2008, I use Dynamic Property Wizard, get this code:
Code: [Select]
STDMETHODIMP CMyOPM::SetCurrentValueData (IUnknown *pUnk, const VARIANT varData) {
if ( pUnk == NULL )
return (E_INVALIDARG) ;
// TODO: add your code here

//----- In case of an enum property, call the following to update the physical combobox
m_pNotify->OnChanged (this) ;
return (S_OK) ;
}

compile, error on this code: m_pNotify->OnChanged (this) ;
error C2594: 'argument' : ambiguous conversions from 'CMyOPM *const ' to 'IUnknown *'   

how modify? thank you!
Title: Re: about new IUnknown question
Post by: It's Alive! on December 08, 2009, 12:30:18 AM
is CMyOPM derived from a base class? if so try down casting.
Title: Re: about new IUnknown question
Post by: ahlzl on December 08, 2009, 07:55:38 AM
Daniel,look that pic:
Title: Re: about new IUnknown question
Post by: ahlzl on December 08, 2009, 07:58:30 AM
2
Title: Re: about new IUnknown question
Post by: ahlzl on December 08, 2009, 08:02:31 AM
3
compile, error on this code: m_pNotify->OnChanged (this) ;
error C2594: 'argument' : ambiguous conversions from 'CMyOPM *const ' to 'IUnknown *'