RE: [Dev-C++] Why doesn't this compile?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ho...> - 2002-10-09 14:54:20
|
> -----Original Message-----
> From: dev...@li...=20
> [mailto:dev...@li...] On Behalf=20
> Of Andrew Vidler
> Sent: Tuesday, October 08, 2002 10:53 PM
> To: C++ Dev
> Subject: [Dev-C++] Why doesn't this compile?
>=20
>=20
> And more importantly, how can I make it compile?!
>=20
>=20
>=20
> #define MY_TYPE IDirect3DBaseTexture8
>=20
> class CBase
> {
> public:
> CBase() {}
Not needed.
> virtual ~CBase() {}
Or better: virtual ~CBase();
>=20
> virtual operator MY_TYPE * () =3D 0;
Where is IDirect3DBaseTexture8 defined?
> };
>=20
> class CDerived : public CBase
> {
> public:
> CDerived() {}
> ~CDerived() {}
You can ommit the above two.
>=20
> operator MY_TYPE * () { return NULL; }
Better: return 0;
IDirect3DBaseTexture8 not defined anywhere.
> };
>=20
> void test()
> {
> CBase *c =3D new CDerived();
> MY_TYPE *f =3D c;
> }
>=20
>=20
>=20
>=20
> The #define is there purely so I could see if the code compiled with
> different types - it doesn't.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL: http://run.to/noicys
|