About Store Forum Documentation Contact



Post Reply 
Extending Game Objects
Author Message
drizztfun Offline
Member

Post: #1
Extending Game Objects
Hello,

its me again with another newbie-question.

I am trying to extend the standard Game::Obj, after failing i tried to stick to the tutorial (09 Extending Game Object class), but i fail at the exact same point. Which is trying to cast the object.


if(MyObj *tile=CAST(MyObj,&obj))
gives me :
error C2683: 'dynamic_cast' : 'EE::Reference<TYPE>' is not a polymorphic type

Even with Google-Help i was not able to understand that problem, or better, why its happening, since the base-class has virtual functions and should be polymorphic then !?

additional info :
STRUCT(MyObj , Game::Obj)
{
// in my code i have ALL the functions etc. from the tutorial mentioned above..
}

But i am missing something i guess.. since its compiletime-error its a c++ problem i guess.

(i am so used to object oriented programming in delphi, but with c++ i feel like i turn on the computer a first time in my life...)
02-27-2011 06:39 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: Extending Game Objects
if(MyObj *tile=CAST(MyObj,obj()))
02-28-2011 01:05 AM
Find all posts by this user Quote this message in a reply
drizztfun Offline
Member

Post: #3
RE: Extending Game Objects
Thank you for your quick reply

I really just did not see the parenthesis, c++ is not my friend yet wink
02-28-2011 05:49 AM
Find all posts by this user Quote this message in a reply
Post Reply