Click here to Skip to main content
15,917,473 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: public & protect question Pin
Naveen11-May-08 21:49
Naveen11-May-08 21:49 
QuestionRe: public & protect question Pin
Rajkumar R11-May-08 21:51
Rajkumar R11-May-08 21:51 
AnswerRe: public & protect question Pin
followait11-May-08 22:19
followait11-May-08 22:19 
GeneralRe: public & protect question Pin
Rajkumar R11-May-08 22:24
Rajkumar R11-May-08 22:24 
QuestionWhich message the Windows sent indication the creation of a new file to Explorer windows Pin
Nitheesh George11-May-08 21:36
Nitheesh George11-May-08 21:36 
AnswerRe: Which message the Windows sent indication the creation of a new file to Explorer windows Pin
Naveen11-May-08 21:45
Naveen11-May-08 21:45 
GeneralRe: Which message the Windows sent indication the creation of a new file to Explorer windows Pin
Nitheesh George11-May-08 22:18
Nitheesh George11-May-08 22:18 
QuestionClass ProtoType Pin
dehseth11-May-08 21:30
dehseth11-May-08 21:30 
Hey everybody,
I got problem with prototype. I do have 2 classes both inherited from CDialog. And these two have pointer, which points each other.
It seems smt like this:

<br />
CChild : CDialog<br />
{<br />
CMain* parent;<br />
<br />
void doSmt();<br />
};<br />
<br />
CMain : CDialog<br />
{<br />
CChild* child;<br />
<br />
void doSmt();<br />
};<br />


I got a header file which includes Child first and Main after. OK now my problem is
if I do not write class prototype of Main in the header file before including Child header file it gives me error: CMain undeclared identifier which makes sense.
But, when I do write prototype:

<br />
class CMain;<br />
<br />
#include "CChild.h"<br />
#include "CMain.h"<br />


then it gives me use of undefined type CMain at the line which I call a function of CMain from CChild class.

And when I do (try to) write a prototype of DoSmt function:

<br />
class CMain;<br />
void CMain::doSmt();<br />
<br />
#include "CChild.h"<br />
#include "CMain.h"<br />

gives me the same error at line where I define function prototype.

So I guess the question is, how can I define prototype of my class function Confused | :confused:

Thanks.... Smile | :)
QuestionRe: Class ProtoType Pin
CPallini11-May-08 21:41
mveCPallini11-May-08 21:41 
AnswerRe: Class ProtoType Pin
dehseth11-May-08 22:23
dehseth11-May-08 22:23 
GeneralRe: Class ProtoType Pin
CPallini11-May-08 22:50
mveCPallini11-May-08 22:50 
QuestionRe: Class ProtoType Pin
dehseth12-May-08 1:35
dehseth12-May-08 1:35 
QuestionRe: Class ProtoType Pin
CPallini12-May-08 2:08
mveCPallini12-May-08 2:08 
GeneralRe: Class ProtoType Pin
dehseth12-May-08 2:55
dehseth12-May-08 2:55 
AnswerRe: Class ProtoType Pin
Rajkumar R11-May-08 21:43
Rajkumar R11-May-08 21:43 
GeneralRe: Class ProtoType Pin
dehseth11-May-08 22:16
dehseth11-May-08 22:16 
GeneralRe: Class ProtoType Pin
Rajkumar R11-May-08 22:27
Rajkumar R11-May-08 22:27 
QuestionMFC Problem with writing file Pin
mihai12311-May-08 21:16
mihai12311-May-08 21:16 
AnswerRe: MFC Problem with writing file Pin
Naveen11-May-08 21:25
Naveen11-May-08 21:25 
GeneralRe: MFC Problem with writing file Pin
mihai12311-May-08 22:10
mihai12311-May-08 22:10 
QuestionSkin Pin
john563211-May-08 21:06
john563211-May-08 21:06 
AnswerRe: Skin Pin
Hamid_RT11-May-08 21:10
Hamid_RT11-May-08 21:10 
QuestionRe: Skin Pin
Rajesh R Subramanian11-May-08 22:53
professionalRajesh R Subramanian11-May-08 22:53 
QuestionCreateThread and AfxBeginThread Pin
tom groezer11-May-08 20:54
tom groezer11-May-08 20:54 
AnswerRe: CreateThread and AfxBeginThread Pin
Hamid_RT11-May-08 21:17
Hamid_RT11-May-08 21:17 

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.