boost::dynamic_pointer_cast doesnt work as expected

Hi,
see these lines using shared_ptr of Boost library:

boost::shared_ptr<Executor> executor(&(createExecutor(subclass,name)));
if(!executor) {
throw LoadingClassException("createExecutor function
of\""+subclass+"\" return null.");
}
//executor points to an object of class ExecDebugger that IS A Executor
//(it's a plugin loaded at run time via Qt)

boost::shared_ptr<Nameable> a=executor;
boost::shared_ptr<Executor> sp;

sp=boost::dynamic_pointer_cast<Executor>(a);

-----------------------------------

a is a Nameable, it points to a ExecDebugger object. ExecDebugger IS A
Executor, Executor IS A Nameable...but sp is always ==0!
Why?!

Thanks,
Diego Bernini
[797 byte] By [BRN] at [2007-11-20 11:02:49]
# 1 Re: boost::dynamic_pointer_cast doesnt work as expected
Can you post a compilable program? There are a lot of undefined things in there that I don't know what they do.
exterminator at 2007-11-9 1:25:00 >