Click here to Skip to main content
15,887,350 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Getting IP of a Network group PC Pin
A_Fa15-Aug-06 19:45
A_Fa15-Aug-06 19:45 
GeneralRe: Getting IP of a Network group PC Pin
Kharfax16-Aug-06 2:26
Kharfax16-Aug-06 2:26 
QuestionHow to auto size a column in a CListCtrl Pin
paperke6715-Aug-06 3:07
paperke6715-Aug-06 3:07 
AnswerRe: How to auto size a column in a CListCtrl Pin
RChin15-Aug-06 4:17
RChin15-Aug-06 4:17 
AnswerRe: How to auto size a column in a CListCtrl Pin
JWood15-Aug-06 4:19
JWood15-Aug-06 4:19 
AnswerRe: How to auto size a column in a CListCtrl Pin
Hamid_RT16-Aug-06 4:55
Hamid_RT16-Aug-06 4:55 
AnswerRe: How to auto size a column in a CListCtrl Pin
paperke6718-Aug-06 11:52
paperke6718-Aug-06 11:52 
QuestionInterdependent classes Pin
CoolASL15-Aug-06 0:24
CoolASL15-Aug-06 0:24 
Hi all,
Please help me out of this problem.
I have 3 classes which all require each other.
The problem is that they fail to recognize each other on compilation and give errors as: Undefined class Two, Undefined class Three and Undefined class One

Someone suggested me forward declaration. But that too did not help.
Where am i going wrong ? Please help me.

Here is my code.. (Actually i am having the same problem with an VC++ program. This is just to simulate the same problem)

File1.h

class One
{
private:
	int one;
public:
	int GetOne();
	Two tw;
	Three th;
};


File2.h
class Two
{
private:
	int two;
public:
	int GetTheTwo();
	One on;
	Three th;
};


File3.h
class Three
{
private:
	int three;
public:
	int GetAslThree();
	One on;
	Two tw;
};


File1.cpp
#ifndef _FILE1_H
#define _FILE1_H
#include "File1.h"
#endif

int One::GetOne()
{
	return one;
}


File2.cpp
#ifndef _FILE2_H
#define _FILE2_H
#include "File2.h"
#endif

int Two::GetTheTwo()
{
	return this->two;
}


File3.cpp
#ifndef _FILE3_H
#define _FILE3_H
#include "File3.h"
#endif

int Three::GetAslThree()
{
	return this->three;
}


Thanks in advance.


*** Who said nothing is impossible? I have been doing it for a long time ***

AnswerRe: Interdependent classes Pin
Maxwell Chen15-Aug-06 0:33
Maxwell Chen15-Aug-06 0:33 
GeneralRe: Interdependent classes Pin
CoolASL15-Aug-06 5:31
CoolASL15-Aug-06 5:31 
AnswerRe: Interdependent classes Pin
Christian Graus15-Aug-06 2:12
protectorChristian Graus15-Aug-06 2:12 
GeneralRe: Interdependent classes Pin
CoolASL15-Aug-06 3:58
CoolASL15-Aug-06 3:58 
GeneralRe: Interdependent classes Pin
Christian Graus15-Aug-06 11:03
protectorChristian Graus15-Aug-06 11:03 
GeneralRe: Interdependent classes Pin
CoolASL15-Aug-06 22:07
CoolASL15-Aug-06 22:07 
AnswerRe: Interdependent classes [modified] Pin
Zac Howland15-Aug-06 9:42
Zac Howland15-Aug-06 9:42 
GeneralRe: Interdependent classes Pin
BadKarma15-Aug-06 21:07
BadKarma15-Aug-06 21:07 
GeneralRe: Interdependent classes Pin
CoolASL15-Aug-06 22:09
CoolASL15-Aug-06 22:09 
GeneralRe: Interdependent classes Pin
Zac Howland16-Aug-06 5:01
Zac Howland16-Aug-06 5:01 
GeneralRe: Interdependent classes Pin
CoolASL15-Aug-06 22:08
CoolASL15-Aug-06 22:08 
QuestionFile reading and writing Pin
69 Bay14-Aug-06 23:51
69 Bay14-Aug-06 23:51 
AnswerRe: File reading and writing Pin
Christian Graus15-Aug-06 0:03
protectorChristian Graus15-Aug-06 0:03 
GeneralRe: File reading and writing Pin
69 Bay15-Aug-06 5:10
69 Bay15-Aug-06 5:10 
GeneralRe: File reading and writing Pin
Zac Howland15-Aug-06 9:50
Zac Howland15-Aug-06 9:50 
GeneralRe: File reading and writing Pin
69 Bay16-Aug-06 2:34
69 Bay16-Aug-06 2:34 
GeneralRe: File reading and writing Pin
Zac Howland16-Aug-06 5:05
Zac Howland16-Aug-06 5:05 

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.