Author Topic: about new IUnknown question  (Read 1917 times)

0 Members and 1 Guest are viewing this topic.

ahlzl

  • Guest
about new IUnknown question
« 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!

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 6934
  • AKA Daniel
Re: about new IUnknown question
« Reply #1 on: December 08, 2009, 12:30:18 AM »
is CMyOPM derived from a base class? if so try down casting.

ahlzl

  • Guest
Re: about new IUnknown question
« Reply #2 on: December 08, 2009, 07:55:38 AM »
Daniel,look that pic:

ahlzl

  • Guest
Re: about new IUnknown question
« Reply #3 on: December 08, 2009, 07:58:30 AM »
2

ahlzl

  • Guest
Re: about new IUnknown question
« Reply #4 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 *'