Click here to Skip to main content
16,015,003 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to check what is the current ODBC driver version Pin
nhuythanh17-Mar-06 18:31
nhuythanh17-Mar-06 18:31 
AnswerRe: How to check what is the current ODBC driver version Pin
Paul Conrad17-Mar-06 19:06
professionalPaul Conrad17-Mar-06 19:06 
QuestionFrame Rate Pin
J512198217-Mar-06 17:57
J512198217-Mar-06 17:57 
Questiontables within richedit controls Pin
Waldermort17-Mar-06 15:26
Waldermort17-Mar-06 15:26 
QuestionQuestions about defines, includes, etc... Pin
Lord Kixdemp17-Mar-06 15:10
Lord Kixdemp17-Mar-06 15:10 
AnswerRe: Questions about defines, includes, etc... Pin
Stephen Hewitt17-Mar-06 15:16
Stephen Hewitt17-Mar-06 15:16 
GeneralRe: Questions about defines, includes, etc... Pin
Lord Kixdemp17-Mar-06 16:46
Lord Kixdemp17-Mar-06 16:46 
GeneralRe: Questions about defines, includes, etc... Pin
Waldermort17-Mar-06 18:16
Waldermort17-Mar-06 18:16 
Create a new header file called "MyDefines.h", place all your defines into this file and eddit them out of your existing files. You may also use a #ifdef #endif block.

Include this file into the top of all your cpp files. You should not #include other .cpp files as stated by the previous poster (there are only extremly rare cases and this is not one of them). The cpp do not need to know about other cpp, it's enough to include the same header. Depending on your compiler all you need is to compile the whole project.

That should fix your problem.

In your MyDefines.h file you may also add function prototypes ie.
void MyFunction1(int foo);
bool MyFunction2(int bar);

And later create these functions in whichever files you need. This will help resolve some undefined function errors.

Also you may add global variables but you try not to use any code. As a rule of thumb, .cpp holds your program, .h binds your program.
GeneralRe: Questions about defines, includes, etc... Pin
Lord Kixdemp18-Mar-06 12:01
Lord Kixdemp18-Mar-06 12:01 
QuestionDerived class causes error Pin
BuckBrown17-Mar-06 13:03
BuckBrown17-Mar-06 13:03 
AnswerRe: Derived class causes error Pin
PJ Arends17-Mar-06 13:24
professionalPJ Arends17-Mar-06 13:24 
AnswerRe: Derived class causes error Pin
Stephen Hewitt17-Mar-06 15:03
Stephen Hewitt17-Mar-06 15:03 
GeneralRe: Derived class causes error Pin
BuckBrown21-Mar-06 3:15
BuckBrown21-Mar-06 3:15 
QuestionVC++ Express Edition 2005 Pin
thierrypp17-Mar-06 10:48
thierrypp17-Mar-06 10:48 
AnswerRe: VC++ Express Edition 2005 Pin
George L. Jackson17-Mar-06 12:03
George L. Jackson17-Mar-06 12:03 
GeneralRe: VC++ Express Edition 2005 Pin
thierrypp17-Mar-06 22:18
thierrypp17-Mar-06 22:18 
Questionrichedit controls Pin
Waldermort17-Mar-06 7:47
Waldermort17-Mar-06 7:47 
AnswerRe: richedit controls Pin
Waldermort17-Mar-06 8:26
Waldermort17-Mar-06 8:26 
QuestionTrackbar Control Pin
amanoullah17-Mar-06 7:44
amanoullah17-Mar-06 7:44 
AnswerRe: Trackbar Control Pin
Waldermort17-Mar-06 7:53
Waldermort17-Mar-06 7:53 
GeneralRe: Trackbar Control Pin
Ravi Bhavnani17-Mar-06 11:33
professionalRavi Bhavnani17-Mar-06 11:33 
QuestionWhere are IE favourites in registry Pin
Chintoo72317-Mar-06 6:10
Chintoo72317-Mar-06 6:10 
AnswerRe: Where are IE favourites in registry Pin
Michael Dunn17-Mar-06 6:53
sitebuilderMichael Dunn17-Mar-06 6:53 
QuestionHow do i create my own bitmap? Pin
woosoo17-Mar-06 5:23
woosoo17-Mar-06 5:23 
AnswerRe: How do i create my own bitmap? Pin
PJ Arends17-Mar-06 13:45
professionalPJ Arends17-Mar-06 13:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.