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

C / C++ / MFC

 
GeneralRe: Docking Bar from DLL Pin
Steve The Plant17-Jul-01 16:12
Steve The Plant17-Jul-01 16:12 
GeneralRe: Docking Bar from DLL Pin
Tomasz Sowinski17-Jul-01 23:09
Tomasz Sowinski17-Jul-01 23:09 
GeneralRe: Docking Bar from DLL Pin
Steve The Plant18-Jul-01 4:00
Steve The Plant18-Jul-01 4:00 
GeneralRe: Docking Bar from DLL Pin
Tomasz Sowinski18-Jul-01 4:09
Tomasz Sowinski18-Jul-01 4:09 
GeneralRich Edit Control Pin
17-Jul-01 9:33
suss17-Jul-01 9:33 
GeneralRe: Rich Edit Control Pin
17-Jul-01 11:51
suss17-Jul-01 11:51 
GeneralFont accent char and Win2000! Pin
Kalai Kandasamy17-Jul-01 8:27
Kalai Kandasamy17-Jul-01 8:27 
QuestionHow do I: Resolve undefined classes when... Pin
CMFC6.0VS.NETUser17-Jul-01 7:54
CMFC6.0VS.NETUser17-Jul-01 7:54 
...on declarces one class and that class need needs a pointer back to the one that declared it.

I am working on a project that has two classes(named here as Root & Child). They are defined in the same header file an Child is defined before Root is defined. Root declarces Child as shown...

class Root
{
public:/*All memebers public*/
Child myChild;
/*Other memeber class, functions, and variables I want to access in Child.*/
}

Ok, now here come Child and want a point to Root so it can access Root's memebers. I define the class like this...

class Child
{
public:/*All memebers public*/
Root* pmyRoot;
/*Other memeber class, functions, and variables for this class*/
}

Now rememebering Child is defined first in the header when I compiled the project then compiler finds, while declaring the pointer to Root, that Root is undefinded. Same thing happens if the Root is defined before Child. The Child is only is going to be used by Root and won't be in a lib. for others to use so this dependent model is Ok(except for the pointer problem). I have tried using class reference forwarding and can up w/ the same undefining problem, but I am still new to class reference forwarding.

Is there way the to access a pointer back to the declaring Object?

AnswerRe: How do I: Resolve undefined classes when... Pin
Chris Losinger17-Jul-01 8:06
professionalChris Losinger17-Jul-01 8:06 
GeneralRe: How do I: Resolve undefined classes when... Pin
17-Jul-01 9:48
suss17-Jul-01 9:48 
AnswerRe: How do I: Resolve undefined classes when... Pin
CMFC6.0VS.NETUser17-Jul-01 9:27
CMFC6.0VS.NETUser17-Jul-01 9:27 
Generalsocket question Pin
Steven Edison17-Jul-01 7:11
Steven Edison17-Jul-01 7:11 
Generalchtmlview question Pin
17-Jul-01 5:55
suss17-Jul-01 5:55 
GeneralRe: chtmlview question Pin
17-Jul-01 7:35
suss17-Jul-01 7:35 
GeneralCosine Rounding Problem Pin
AndyC17-Jul-01 5:44
AndyC17-Jul-01 5:44 
GeneralRe: Cosine Rounding Problem Pin
Tomasz Sowinski17-Jul-01 5:57
Tomasz Sowinski17-Jul-01 5:57 
GeneralRe: Cosine Rounding Problem Pin
Paolo Messina17-Jul-01 10:51
professionalPaolo Messina17-Jul-01 10:51 
GeneralRegistry Question Pin
Fady Elias17-Jul-01 5:33
Fady Elias17-Jul-01 5:33 
GeneralRe: Registry Question Pin
Ollie17-Jul-01 6:08
Ollie17-Jul-01 6:08 
GeneralRe: Registry Question Pin
17-Jul-01 7:38
suss17-Jul-01 7:38 
GeneralRe: Registry Question Pin
Fady Elias17-Jul-01 7:47
Fady Elias17-Jul-01 7:47 
GeneralAbstract class members assistance Pin
Chris Meech17-Jul-01 5:11
Chris Meech17-Jul-01 5:11 
GeneralRe: Abstract class members assistance Pin
Tomasz Sowinski17-Jul-01 5:21
Tomasz Sowinski17-Jul-01 5:21 
GeneralRe: Abstract class members assistance Pin
Chris Meech17-Jul-01 5:28
Chris Meech17-Jul-01 5:28 
GeneralColumns In List Control Pin
AJ12317-Jul-01 4:21
AJ12317-Jul-01 4:21 

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.