 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Tue Aug 22, 2006 3:42 am Post subject: My class in second form |
|
|
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
|
Posted: Tue Aug 22, 2006 8:10 am Post subject: Re: My class in second form |
|
|
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!  |
|
| 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
|
|