|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Lets try that again: Need help with pure virtual base class
============================================================ Feeling blue about the state of your email inbox? Then you'll be tickled pink to hear about our free email organization solution. Learn more at http://click.topica.com/caaabBybUrGczbU68iFa/register ============================================================ Sorry about the prior post accidentally<sp> hit the send now button. Crap!! Ok, I'll try again this time a tad more code. Oh, and I would be more than welcome to send the source to anyone who might know the problem. Probably be better to look at the source anyway and tell me what a hack I am. ////////////////////////////////////////////////////////////////////// To anybody who knows, Ok here we go. I am trying to create a base class through which all of my objects to be drawn to the screen will be derived from. So I will try to break the problem down accordingly -> I instantiate a derived object and a pointer to the base object and set the address of the pointer to the derived object like so: CRect myRect; CObject *object; object = &myRect; Everything is good up to this part. I then call on my engine to append the object to a list like so: Engine.AppendObjectToList(object); The CEngine method above takes as an argument a pointer to an object and the definition looks like this. class CEngine{ private: //this is where the list will be CObject *polyObject[MAX]; //just trying to get one object up. CObject *polyObject; public: void AppendObjectToList(CObject *object){ polyObject = object; } }; I then call draw on the polyObject by using the this operator -> (polyObject->drawObject();) and keep getting unhandled exception at some memory address blah, blah, blah. Anyway I am stepping through the code and and the vfptr isn't being assigned. My base class looks like this. class CObject{ private: publice: virtual void drawObject() = 0; virtual void moveObject() = 0; }; I think this is the right declaration for a abstract class. This is all probably jibberish so if you want to look at my source give your email address being that I can't figure out how to append files and put them up on the list. Also I could just cut and paste the code in if someone would like. Thanks ahead of time, Will ==^================================================================ EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrGcz.bU68iF Or send an email To: gameprogrammer-unsubscribe@topica.com This email was sent to: list@pendleton.com T O P I C A -- Learn More. Surf Less. Newsletters, Tips and Discussions on Topics You Choose. http://www.topica.com/partner/tag01 ==^================================================================
|
|