 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Mr B Guest
|
Posted: Mon Apr 02, 2007 4:10 pm Post subject: Passing TForm to a function |
|
|
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 |
|
 |
|
|
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
|
|