Click here to Skip to main content
15,909,324 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ADO AND VISUAL C++ AND ASP Pin
Alex Gorev9-Jun-00 10:20
Alex Gorev9-Jun-00 10:20 
GeneralRe: ADO AND VISUAL C++ AND ASP Pin
Uwe Keim10-Jun-00 4:05
sitebuilderUwe Keim10-Jun-00 4:05 
QuestionIs there a way to revert a document based application to a dialog form? Pin
Terry9-Jun-00 8:37
Terry9-Jun-00 8:37 
AnswerRe: Is there a way to revert a document based application to a dialog form? Pin
Buck10-Jun-00 21:10
Buck10-Jun-00 21:10 
GeneralBlit to a CBitmap Pin
Christoph Rupp9-Jun-00 5:04
sussChristoph Rupp9-Jun-00 5:04 
GeneralRe: Blit to a CBitmap Pin
Paolo Messina9-Jun-00 13:34
professionalPaolo Messina9-Jun-00 13:34 
GeneralDeviceCapabilities Pin
Gen12-Jun-00 23:29
Gen12-Jun-00 23:29 
GeneralImplementing "Parent" properties in the OO Land Pin
Matthias12-Jun-00 22:34
Matthias12-Jun-00 22:34 
Hello,

in the OO-Land (where we all like to live) it's common to implement Object Models, e.g. this one:

CCompany
>CEmployees
>CEmployee

For the sake of simplicity we'll say that the company class has a member of type CTypedPtrArray (it's the CEmployees collection). Now I'd like to design my hierarchy so, that each employee has got reference (pointer) to it's parent (company).

Now my problem:
Let's say I my CCompany looks somewhat like this:

#include "employee.h" // my employee class
class CCompany{
public:
// details ommitted
CEmployee& AddEmployee(const CEmployee& newemp, CCompany* parent);
private:
CTypedPtrArray<cptrarray, cemployee*=""> m_aEmployees;
}

In this class I need to #include "employee.h". This is fine so far. Now the CEmployee class:

#include "company.h"
class CEmployee{
// details ommitted
private:
CCompany* m_ptrParent;
}

This code doesn't compile. Yes, not even if it is correctly implemented. If you include header A into header B and header B into header A, funny things happen. How do I get this working? What I'm asking for is rather a general answer on how to design such a thing rather then a void*-type-of solution.

Many thanx for your time

Matthias
GeneralRe: Implementing Pin
Uwe Keim12-Jun-00 23:17
sitebuilderUwe Keim12-Jun-00 23:17 
GeneralRe: Implementing Pin
Alvaro Mendez13-Jun-00 5:30
Alvaro Mendez13-Jun-00 5:30 
GeneralThank you guys! Pin
Matthias13-Jun-00 9:27
Matthias13-Jun-00 9:27 
QuestionHow do I create popup submenus dynamically Pin
Mike newberry12-Jun-00 5:52
sussMike newberry12-Jun-00 5:52 
AnswerRe: How do I create popup submenus dynamically Pin
GeVanCo19-Jun-00 20:11
GeVanCo19-Jun-00 20:11 
GeneralRe: How do I create popup submenus dynamically Pin
GeVanCo19-Jun-00 20:20
GeVanCo19-Jun-00 20:20 
GeneralLocalization (Date Time Numeric Currency Pin
Gary12-Jun-00 4:45
Gary12-Jun-00 4:45 
GeneralRe: Localization (Date Time Numeric Currency Pin
Mike Dunn12-Jun-00 9:45
Mike Dunn12-Jun-00 9:45 
GeneralAdding to IE context menu Pin
Bhaskar12-Jun-00 4:28
Bhaskar12-Jun-00 4:28 
GeneralUsing Bookmarks with Jet OLEDB Provider Pin
QamarAlZaman Habeek12-Jun-00 1:21
sussQamarAlZaman Habeek12-Jun-00 1:21 
Generalactivating a view with a mouse click Pin
Steve Kearon11-Jun-00 22:39
Steve Kearon11-Jun-00 22:39 
GeneralRemoving DLL exports Pin
Ben Burnett11-Jun-00 21:38
Ben Burnett11-Jun-00 21:38 
GeneralRe: Removing DLL exports Pin
Tim Deveaux12-Jun-00 12:41
Tim Deveaux12-Jun-00 12:41 
GeneralResource Difference Tool Pin
Blake Miller11-Jun-00 17:48
Blake Miller11-Jun-00 17:48 
GeneralRe: Resource Difference Tool Pin
Paolo Messina12-Jun-00 11:30
professionalPaolo Messina12-Jun-00 11:30 
GeneralLearning ATL Pin
Ryan Park11-Jun-00 15:07
Ryan Park11-Jun-00 15:07 
GeneralRe: Learning ATL Pin
Alex Gorev12-Jun-00 4:03
Alex Gorev12-Jun-00 4:03 

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.