|
From: Andrew V. <av...@in...> - 2002-10-08 19:53:12
|
And more importantly, how can I make it compile?!
#define MY_TYPE IDirect3DBaseTexture8
class CBase
{
public:
CBase() {}
virtual ~CBase() {}
virtual operator MY_TYPE * () = 0;
};
class CDerived : public CBase
{
public:
CDerived() {}
~CDerived() {}
operator MY_TYPE * () { return NULL; }
};
void test()
{
CBase *c = new CDerived();
MY_TYPE *f = c;
}
The #define is there purely so I could see if the code compiled with
different types - it doesn't.
TIA,
Andrew Vidler.
|