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

C / C++ / MFC

 
GeneralRe: OOP is driving me crazy! Pin
led mike11-Dec-07 7:53
led mike11-Dec-07 7:53 
GeneralRe: OOP is driving me crazy! Pin
Matthew Faithfull11-Dec-07 8:03
Matthew Faithfull11-Dec-07 8:03 
GeneralRe: OOP is driving me crazy! Pin
CPallini11-Dec-07 7:19
mveCPallini11-Dec-07 7:19 
GeneralRe: OOP is driving me crazy! Pin
led mike11-Dec-07 7:59
led mike11-Dec-07 7:59 
GeneralRe: OOP is driving me crazy! Pin
CPallini11-Dec-07 21:42
mveCPallini11-Dec-07 21:42 
GeneralRe: OOP is driving me crazy! Pin
led mike12-Dec-07 5:16
led mike12-Dec-07 5:16 
GeneralRe: OOP is driving me crazy! Pin
CPallini12-Dec-07 5:25
mveCPallini12-Dec-07 5:25 
GeneralRe: OOP is driving me crazy! Pin
CPallini11-Dec-07 0:33
mveCPallini11-Dec-07 0:33 
Well, this is not a big problem.
For instance, you can use pointers instead of references and avoid including headers inside each other exploiting class deferred declaration:
// this is B.h
 
#pragma once
class A; // class a deferred declaration
class B
{
	A * _pA;
public:
	B(A * pA):_pA(pA){}
public:
	~B(void){};
};


Note I've not included A.h in the class B header. Of course you have to include A.h inside B.cpp to do something useful with the _pA pointer, but this will be not a problem anymore.

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.


GeneralRe: OOP is driving me crazy! Pin
led mike11-Dec-07 4:58
led mike11-Dec-07 4:58 
GeneralRe: OOP is driving me crazy! [modified] Pin
CPallini11-Dec-07 5:05
mveCPallini11-Dec-07 5:05 
GeneralRe: OOP is driving me crazy! Pin
Nelek10-Dec-07 23:45
protectorNelek10-Dec-07 23:45 
GeneralRe: OOP is driving me crazy! Pin
Matthew Faithfull11-Dec-07 0:03
Matthew Faithfull11-Dec-07 0:03 
GeneralRe: OOP is driving me crazy! Pin
Lord Kixdemp11-Dec-07 0:15
Lord Kixdemp11-Dec-07 0:15 
GeneralRe: OOP is driving me crazy! Pin
Lord Kixdemp11-Dec-07 0:15
Lord Kixdemp11-Dec-07 0:15 
GeneralRe: OOP is driving me crazy! Pin
led mike11-Dec-07 5:10
led mike11-Dec-07 5:10 
GeneralRe: OOP is driving me crazy! Pin
Lord Kixdemp11-Dec-07 18:12
Lord Kixdemp11-Dec-07 18:12 
GeneralRe: OOP is driving me crazy! Pin
led mike12-Dec-07 5:31
led mike12-Dec-07 5:31 
GeneralRe: OOP is driving me crazy! Pin
KarstenK11-Dec-07 2:00
mveKarstenK11-Dec-07 2:00 
QuestionIs anybody to solve my probblem Pin
rajneshmalik10-Dec-07 22:19
rajneshmalik10-Dec-07 22:19 
GeneralRe: Is anybody to solve my probblem Pin
Nelek10-Dec-07 23:42
protectorNelek10-Dec-07 23:42 
GeneralLoading an ICON from a file Pin
eli1502197910-Dec-07 22:18
eli1502197910-Dec-07 22:18 
GeneralRe: Loading an ICON from a file Pin
CPallini10-Dec-07 22:42
mveCPallini10-Dec-07 22:42 
GeneralRe: Loading an ICON from a file Pin
eli1502197910-Dec-07 22:54
eli1502197910-Dec-07 22:54 
GeneralRe: Loading an ICON from a file Pin
Naveen10-Dec-07 23:25
Naveen10-Dec-07 23:25 
QuestionRe: Loading an ICON from a file Pin
Hamid_RT11-Dec-07 0:02
Hamid_RT11-Dec-07 0:02 

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.