Jump to content

  • Log In with Google      Sign In   
  • Create Account


- - - - -

base class method registration


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Aggrav8d   Members   -  Reputation: 133

Like
0Likes
Like

Posted 27 October 2004 - 12:22 PM

I have class _A { public: inline void Method(); }; class _B : public _A {}; When I try to register asEngine->RegisterObjectMethod("_B","void Method()",asMETHOD(_B, Method), asCALL_THISCALL); it says it doesn't like that. I also tried it asMETHOD(_A,Method), which it liked even less. I seem to recall there was a restriction on virtual methods, but I was not aware it extended to ALL base class methods. Is my understanding correct or have I missed something? Thanks!

Dan Royer, OwnerMarginally Clever Games

Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3309

Like
0Likes
Like

Posted 28 October 2004 - 03:24 AM

This is in fact a limitation of C++. It can't resolve _B::Method, because it wasn't inherited. _A::Method, ought to work. I don't know why that isn't so. Try making the method virtual.

Virtual methods are supported, as well as virtual methods from classes with multiple inheritance. The only thing that is not supported is virtual inheritance, i.e:

class _B : virtual _A {};





AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS