HI Thanks...
but the scenario that you have understood is bit different.
i dont need any thing related to command line.
I get the solution from the following link but stuck in some point
http://support.microsoft.com/kb/828736
That it is possible that i can have interface which has some method which return run time object if i am in c++ i will say it can return
interface MyInterface
{
virtual void * GetObject()=0;
};
class MyDerived : MyInterface
{
public:
void * GetObject()
{
return reinterpret_cast <void *>(this);
}
};
----------------
The above code compiles beautifully but fails when u say:-
MyInterface *myIptr = new MyDerived();
Error 2 error C2243: 'type cast' : conversion from 'MyDerived *' to 'MyInterface *' exists, but is inaccessible
I need same in c# because my interface needs to return the duplicate copy of the object
if some work around i will happy !!