BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Passing TForm to a function

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
Mr B
Guest





PostPosted: Mon Apr 02, 2007 4:10 pm    Post subject: Passing TForm to a function Reply with quote



Hi all,
I'm having difficulty passing an extended TForm to a method within a
class. My personalised TTWorld form that inherits from the TForm
Component contains a stringgrid and a vector collection of objects
(creature class). I want the TTWorld object to iterate through the
vector of Creatures and execute certain methods of creatures, one of
which requires the TTWorld object itself to execute one its its
methods (Wrap). The creature object can receieve the string grid
within the TTWorld object fine, but for some reason i can't get it to
accept the TTWorld object.

void GetSurroundings(TTWorld &theworld);
//This one doesn't work, it tells me that a ")" is expected.

void GetSurroundings(TForm &theworld);
//This one comes up with all kinds of problems with the vector (could
this be because an object contained within the vector is using the
world object that contains the vector! if that makes sense!?) How can
I get around this??

thanks
Daniel
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.