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 

My class in second form

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






PostPosted: Tue Aug 22, 2006 3:42 am    Post subject: My class in second form Reply with quote



Hi!

I'm declaring in my.h several classes and their methods, which operate
on elements in Form1, so I have there also Form1.h included, then I
include my.h to the Form1.cpp and all works.. I know it's a little bit
lame :)

Now the PROBLEM - I've created Form3 and I want to create in it's .h
file (in public section) pointer to an object of class declared in my.h
and a method which takes as an argument pointer to another class also
declared in my.h

I get "type name expected" error when I don't include my.h to form3.h,
but when I include it I get lots of errors like "Body has already been
declared for function XYZ" or "multiple declaration of XYZ"

Plz help!!
Thx a lot 4 any answer!
Back to top
Masta Krishna
Guest





PostPosted: Tue Aug 22, 2006 8:10 am    Post subject: Re: My class in second form Reply with quote



OK - Maybe I'm lame but I've found the solution by myself :)

The answer is preporcessor

I had to add:
#ifndef _my_h
#define _my_h
on the beginning

and #endif on the end of my.h file - et voila - it works! Smile
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language) 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.