header file?
how do you make your own header file. do you just save the file as .h? and how do you call on the header file if its your own?
[126 byte] By [
tralfas] at [2007-11-11 7:41:08]

# 1 Re: header file?
The standard is to name the header files with ".h" extension. To include your own header file, write
#include "myheaderfile.h"
nspils at 2007-11-11 21:01:56 >

# 2 Re: header file?
how do i get my header file to run at a certain time?
# 3 Re: header file?
Header files do not execute -- normally, they are definations of classes and functions and types and stuff. "Main" is the starting point for all c++ programs (MFC does rename this just to make life difficult) -- what did you really want to know ??
jonnin at 2007-11-11 21:04:07 >

# 4 Re: header file?
i want to link together a couple of programs and then have one main program.
main
/ | \
program1 | program3
program 2
then in main it would have
cout << "press 1 for program one"
<< "press 2 for program two"
<< "press 3 for program three";
cin >> press;
then it would go to those programs or is it better to just have all three programs in one and then just make switches to them.
# 5 Re: header file?
if you have three programs, then you need three main()s and the issue of header files becomes irrelavant. You simply call system("prog1.exe") to execute a program from another program ("prog1.exe" is the name you give to the executable file). Header files are used only within the context of a single program that is made of several source files that are compiled seprately.
Danny at 2007-11-11 21:06:01 >

# 6 Re: header file?
I completely agree that header is not the place to put your real code, though nothing prevent you to do so. It's just not a good practice to do that (read any book of C/C++, I bet that you'll always find this).
To call external program, you can launch it like in command line (using API), which is quite complicated to do or even using COM (which I suggest to avoid, unless you're sure of yourself :))
I'm not so clear of what you need, but including everything in 1 program, as long as it's modular is always easier to control (ex: launching another program in command line, you loose control of it from your main).
# 7 Re: header file?
You do not need a C++ program for this, a script / batch file will do this. However, if you do want to use c++, check out
system("command"); //simple, recommended for most tasks
shellexecute***(?) (MFC/WIN32 only) //you can hide the "dos" box with this
spawn****() (UNIX, WIN32 supports too?) //Not sure of pros/cons
*** are "family" functions (several different ones with similar names for slightly different uses)
jonnin at 2007-11-11 21:08:04 >
