Author Topic: about IUnknown question  (Read 3525 times)

0 Members and 1 Guest are viewing this topic.

ahlzl

  • Guest
about IUnknown question
« on: October 30, 2008, 11:14:23 AM »
Hello:
in ARX2002 SDK\samples\simpledynprops\categorizedproperty.cpp, have this code:
Code: [Select]
STDMETHODIMP CCategorizedProperty::GetCurrentValueData(/*in*/LONG objectID,
/*[out]*/VARIANT* pVarData)

in ARX2009, I use Dynamic Property Wizard, get this code:
Code: [Select]
STDMETHODIMP CCategorizedProperty::GetCurrentValueData(IUnknown *pUnk,
/*[out]*/VARIANT* pVarData)


I copy SDK2002'code, error!
how modify? thank you!

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 7096
  • AKA Daniel
Re: about IUnknown question
« Reply #1 on: November 02, 2008, 12:45:57 AM »
Did you get this working? Sorry I know very little about COM. 
Retired

ahlzl

  • Guest
Re: about IUnknown question
« Reply #2 on: November 02, 2008, 03:37:42 AM »
Daniel, this sample is OPM .

Alexander Rivilis

  • Bull Frog
  • Posts: 213
  • Programmer from Kyiv (Ukraine)
Re: about IUnknown question
« Reply #3 on: November 03, 2008, 04:50:05 AM »
in ARX2009, I use Dynamic Property Wizard, get this code:
Code: [Select]
STDMETHODIMP CCategorizedProperty::GetCurrentValueData(IUnknown *pUnk,
/*[out]*/VARIANT* pVarData)
AcAxGetIUnknownOfObject and IAcadBaseObject.GetObjectId can help you.

ahlzl

  • Guest
Re: about IUnknown question
« Reply #4 on: November 04, 2008, 04:45:27 AM »
thank you,Alexander Rivilis.

but I am fail :-(
how get AcDbObjectId from IUnknown?
thanks again!

Alexander Rivilis

  • Bull Frog
  • Posts: 213
  • Programmer from Kyiv (Ukraine)
Re: about IUnknown question
« Reply #5 on: November 04, 2008, 05:10:59 AM »
Code: [Select]
  long oldid; ((IAcadObject *)pUnk)->get_ObjectID(&oldid);
  AcDbObjectId id; id.setFromOldId(oldid);
  AcDbHandle h = id.handle();
  ACHAR buf[17]; h.getIntoAsciiBuffer(buf);
  acutPrintf(_T("\nHandle is %s"),buf);
« Last Edit: October 12, 2016, 06:09:51 AM by Alexander Rivilis »

ahlzl

  • Guest
Re: about IUnknown question
« Reply #6 on: November 04, 2008, 06:14:52 AM »
success !
thank you, greate Alexander Rivilis !