Hyena
April 27th, 1999, 04:01 PM
how do i make my programs into header files? i know that you save the class definition as a .h file, and the member functions as .ccp with identical names to the precious. but i also know you need to include some other definitions, which i do not know. please tell me how (examples would be appreciated, or i can email the program that i need changed into a header).
additionaly, BOOL doesn't seem to work with my compiler (Borland 5.0 or 6.0, i use both). do i need to include a certain header file?
Rudolf
April 28th, 1999, 02:09 AM
I can't see a short answer to Your first problem. Just include the headers with the definitions You need (Borland help tells You which ones You need for the Borland functions, and for Your own ones use their headers). Any C++ (or even C) program should be an example. There are a few things You have to avoid by doing this (I can see the lots of comments to this answer...) - the most important is: avoid cycles (for example including a.h in b.h, b.h in c.h and c.h in a.h). But You better look for these things in books.
BOOL normally isn't defined by the C language. Some commercial compilers do it, others (like Borland) not. But You can define it by Yourself.
As far as I remember the usual way is more or less
#define BOOL long
(or short, int, UINT etc - as You like)
#define FALSE 0
#define TRUE !FALSE
I hope this helps. If not - there should be lots of people who can explain it better than I can.
Rudolf