Below is a simplified definition of my interfaces/classes. I cannot modify the definition of A_Base. I am trying to use a dynamic_cast to change the A_Base* to the template class A<B>* (Line 22). This code worked when I last used it with Visual Studio.Net.
interface A_Base {
// set() does not exist in this definition.
}
template <class T>
class A public: A_Base {
private:
T _embeddedT;
public:
void set(int i);
void init(void) {
_embedded.init(this);
}
interface B_Base {
virtualvoid init(A_Base* a);
}
class b : public B_Base {
void init(A_Base* a) {
dynamic_cast<A<B>*>(a)->set(1);
}
}