I need to query up and query down the interface pointer in my program,
I have interface defined
struct Iinterface1
{
methods X1()
}
struct Iinterface2 : Iinterface1
{
methods X2()
}
queryInterface( *interface)
{
returns the pointer to one of above interface
}
i can query and get the pointer to interface using function queryInterface()
since interface2 came later, i need to support both method1 and method2 in my program, so i can not have interface pointer to interface2 and execute method x1 and method x2. what i am looking is how to upgrade or change interface pointer during execution. so i would query and get pointer to interface1 and execute method x1 and later when i want to execute method x2 , i need to query up my pointer to interface2 so i can execute method x2. makes sense? appreciate any help with example.