[Ace-users] a objects convertion problem in ACE Service Configurator framework

chunandlee chunandlee at 163.com
Thu Aug 23 16:03:38 CDT 2007


hi! everybody.i got a problem. help me,please!

my computer enviroment:
ubuntu 6.06
g++  4.0
gdb
ACE 5.5.0

     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
use usenet.

  thanks for your kind.

  regards.



More information about the Ace-users mailing list