Click here to Skip to main content
15,916,463 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: help me!!! Pin
Ylis9-Mar-05 9:27
Ylis9-Mar-05 9:27 
GeneralProblem with main MDI Frame window Pin
Anonymous9-Mar-05 8:56
Anonymous9-Mar-05 8:56 
GeneralRe: Problem with main MDI Frame window Pin
Ryan Binns9-Mar-05 17:30
Ryan Binns9-Mar-05 17:30 
GeneralInclude Help Needed Pin
Jeryth9-Mar-05 7:53
Jeryth9-Mar-05 7:53 
GeneralRe: Include Help Needed Pin
David Crow9-Mar-05 8:06
David Crow9-Mar-05 8:06 
GeneralRe: Include Help Needed Pin
Jeryth9-Mar-05 13:12
Jeryth9-Mar-05 13:12 
GeneralRe: Include Help Needed Pin
Steen Krogsgaard9-Mar-05 22:01
Steen Krogsgaard9-Mar-05 22:01 
GeneralRe: Include Help Needed Pin
Jeryth10-Mar-05 1:11
Jeryth10-Mar-05 1:11 
Steen Krogsgaard wrote:
Are you absolutely sure that your problems stems from multiple inclusions of the classA header?

I'll say I'm 95% sure that's the cause. All the linking errors mentioned Class A name in the error field. But now I have a new problem. I took Dave Crow's advice and redid my #ifndef statements. Now I'm testing in the class header file if an appropriate preprocessor tag has been defined, if not then it defines it and it continues to have the class declared. If it already has, it skips it. After the initial #ifndef I use separate ones to test for any required includes for that class. For example, Class A looks like this:

<br />
#ifndef CLASS_B_INC<br />
#define CLASS_B_INC<br />
#pragma once<br />
<br />
#ifndef CLASS_A_INC<br />
#include "CLASS_A.h"<br />
#endif<br />
<br />
//Rest of Class here<br />
<br />
#endif<br />


I think part of my problem was that I was possibly defining the pre-processor tags multiple times. This way, they only get defined in that class' header file. Note here that Class B won't try to define CLASS_A_INC ( that's left to Class A to do ) it will just include it and when that does Class A will define it on its own.

Now something like that written above is in all .h files. The .cpp files only have
<br />
#ifndef CLASS_A_INC<br />
#include "CLASS_A.h"<br />
#endif<br />

for their own classes, so above would be the Class A .cpp file. Now I'm getting errors that certain elements can't be found such as "cout : undeclared identifier" and "Class E : undeclared identifier" so some of my #include statements aren't being processed and I don't know why.

________________________________________________________________________
The question "Do computers think?" is the same as "Can submarines swim?"
Signature Red Studios

Jeryth
GeneralRe: Include Help Needed Pin
Steen Krogsgaard10-Mar-05 1:25
Steen Krogsgaard10-Mar-05 1:25 
GeneralRe: Include Help Needed Pin
Jeryth10-Mar-05 5:18
Jeryth10-Mar-05 5:18 
GeneralRe: Include Help Needed Pin
Steen Krogsgaard10-Mar-05 5:27
Steen Krogsgaard10-Mar-05 5:27 
GeneralRe: Include Help Needed Pin
Jeryth10-Mar-05 6:11
Jeryth10-Mar-05 6:11 
GeneralRe: Include Help Needed Pin
Steen Krogsgaard 210-Mar-05 7:34
Steen Krogsgaard 210-Mar-05 7:34 
GeneralRe: Include Help Needed Pin
Jeryth14-Mar-05 5:50
Jeryth14-Mar-05 5:50 
GeneralRe: Include Help Needed Pin
Steen Krogsgaard 214-Mar-05 9:32
Steen Krogsgaard 214-Mar-05 9:32 
GeneralRe: Include Help Needed Pin
Jeryth14-Mar-05 17:29
Jeryth14-Mar-05 17:29 
GeneralRe: Include Help Needed Pin
Steen Krogsgaard 217-Mar-05 7:15
Steen Krogsgaard 217-Mar-05 7:15 
GeneralRe: Include Help Needed Pin
Steen Krogsgaard10-Mar-05 1:28
Steen Krogsgaard10-Mar-05 1:28 
GeneralRe: Include Help Needed Pin
Jeryth10-Mar-05 4:40
Jeryth10-Mar-05 4:40 
Generalexecution! Pin
mpapeo9-Mar-05 7:42
mpapeo9-Mar-05 7:42 
GeneralRe: execution! Pin
David Crow9-Mar-05 8:12
David Crow9-Mar-05 8:12 
GeneralRe: execution! Pin
mpapeo9-Mar-05 8:26
mpapeo9-Mar-05 8:26 
GeneralRe: execution! Pin
David Crow9-Mar-05 8:57
David Crow9-Mar-05 8:57 
GeneralRe: execution! Pin
mpapeo9-Mar-05 10:04
mpapeo9-Mar-05 10:04 
GeneralRe: execution! Pin
David Crow9-Mar-05 10:11
David Crow9-Mar-05 10:11 

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.