c++ - cast from Iunknown to another type -


i need cast variable iunknown type type(spaceclaim::api::v10::session^) m working c /cli , can't find solution

to fix prb here code :

 gcroot<spaceclaim::api::v10::session^>  m_piapplication;    stdmethodimp cemwcadlinkctrl::setemwcadlinkapplication(iunknown* pcadapplication)  {   if ( pcadapplication == null )  return s_false;    m_piapplication = (spaceclaim::api::v10::session^)pcadapplication;  //error   return s_ok;  }  

plz if there 1 how can ill gratful thks,

iunknown base class com objects whereas c++/cli ref class have .net object base class. there's no casting 1 other not related in way. if you're in c++ should calling pcadapplication->queryinterface() @ interface need , calling methods on that. highly recommend using atl smart pointers manage reference counts (and many other useful com helper functions).


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -