hi
i am working on a interfacelayer that should connect a odbms and ice - for now to use php and later to replace com.
i came a long way generating sources for the interface but now i am stuck with a simple cast problem.
i have to get the (cpp) instance i put in a proxy before - i dont get it
to illustrate what i mean please read the following simplifyed scenario
if you need the complete project i'll tar cjf and upload
code:
[slice]
[cpp]Code:class PropertyHandle { PropertyHandle* GetPropertyHandle(string path); int GetIndex(PropertyHandle* hdl); };
[class]Code:PropertyHandlePrx PropertyHandleI::GetPropertyHandle(const ::std::string& path, const Ice::Current& current) { cout << "GPH(" << path << ")" << endl; PropertyHandleI* p = new PropertyHandleI; p->Open(this,(char*)path.c_str()); cout << (::PropertyHandle*) p << endl; //0x9e7288 return PropertyHandlePrx::uncheckedCast(current.adapter->addWithUUID(p)); } ::Ice::Int PropertyHandleI::GetIndex(const PropertyHandlePrx& phprx, const Ice::Current& current) { PropertyHandleI *i = (PropertyHandleI*)&(*phprx); ::PropertyHandle *ph = (::PropertyHandle*)i; cout << ph << endl; //0xa0f368 cout << "GIndx(" << ph->GetCurrentIndex() << ")" << endl; return ph->GetCurrentIndex(); }
[client code]Code:class PropertyHandleI : virtual public MyModule::PropertyHandle, public ::PropertyHandle
as i learned from various cout sessions the ice proxy object that GetIndex gets passed is GUID the same but i need the PropertyHandleI to pass it to the ::PropertyHandle functionsCode:$ph = $ph0->GetPropertyHandle("classes.functions"); $ph0->GetIndex($ph);
any ideas what i am doing wrong?
is there a different way to cast the proxy back into a instance?
thanks for your help
peace

Reply With Quote