[Ace-users] a objects convertion problem in ACE Service
chunandlee at 163.com
Thu Aug 23 16:03:38 CDT 2007
hi! everybody.i got a problem. help me,please!
my computer enviroment:
I use ACE Service Configurator framework to set my program.there
is a shared object libDllTest.so, a class called DllTest inherited
form ACE_Service_Object and IInterface. IInterface is a interface.
according to C++NP2, i write a class ACE_Dynamic_Service.
ACE_Service_Object* obj =
ACE_Dynamic_Service<ACE_Service_Object>::instance("DllTest"); this is
right, the obj is non-null.
but this sentence.IInterface* face =
ACE_Dynamic_Service<IInterface>::instance("DllTest"); the returned
value face is null.
through analysis, i find the prolem occurs on ACE_dynamic_cast.
in the ACE_Dynamic_Service's decleration.
ACE_Service_Object *obj= ACE_static_cast(ACE_Service_Object*, type-
>object()); this line is right.obj is non-null.
return ACE_dynamic_cast(Type*, obj); here is wrong.
I don't know whether i put my code on here. this is my first time to
thanks for your kind.
More information about the Ace-users