Click here to Skip to main content
15,897,519 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRead/Write Files(ex:music files) meta data Pin
A&Ms6-May-09 18:49
A&Ms6-May-09 18:49 
AnswerRe: Read/Write Files(ex:music files) meta data Pin
Stuart Dootson6-May-09 20:22
professionalStuart Dootson6-May-09 20:22 
AnswerRe: Read/Write Files(ex:music files) meta data Pin
A&Ms6-May-09 21:11
A&Ms6-May-09 21:11 
QuestionFile Deletion using SHFILEOPSTRUCT & SHFileOperation Pin
Padmanabha_M6-May-09 18:35
Padmanabha_M6-May-09 18:35 
AnswerRe: File Deletion using SHFILEOPSTRUCT & SHFileOperation Pin
«_Superman_»6-May-09 19:17
professional«_Superman_»6-May-09 19:17 
GeneralRe: File Deletion using SHFILEOPSTRUCT & SHFileOperation Pin
Padmanabha_M6-May-09 20:08
Padmanabha_M6-May-09 20:08 
GeneralRe: File Deletion using SHFILEOPSTRUCT & SHFileOperation Pin
David Crow7-May-09 3:31
David Crow7-May-09 3:31 
QuestionNeed help on Dock Window Pin
nick2reg6-May-09 17:22
nick2reg6-May-09 17:22 
QuestionVery difficult problem about CExplorer1. Pin
cwj_6-May-09 15:38
cwj_6-May-09 15:38 
QuestionRe: Very difficult problem about CExplorer1. Pin
Madhu Nair6-May-09 17:36
Madhu Nair6-May-09 17:36 
AnswerRe: Very difficult problem about CExplorer1. Pin
Stuart Dootson6-May-09 20:06
professionalStuart Dootson6-May-09 20:06 
AnswerRe: Very difficult problem about CExplorer1. Pin
virusest31-Dec-10 18:13
virusest31-Dec-10 18:13 
Questionmatrix in window Pin
kiemxai6-May-09 14:45
kiemxai6-May-09 14:45 
AnswerRe: matrix in window Pin
Stuart Dootson6-May-09 19:41
professionalStuart Dootson6-May-09 19:41 
GeneralRe: matrix in window Pin
kiemxai6-May-09 23:19
kiemxai6-May-09 23:19 
GeneralRe: matrix in window Pin
Stuart Dootson6-May-09 23:22
professionalStuart Dootson6-May-09 23:22 
QuestionInclude order issues Pin
__DanC__6-May-09 9:53
__DanC__6-May-09 9:53 
AnswerRe: Include order issues Pin
Stuart Dootson6-May-09 10:40
professionalStuart Dootson6-May-09 10:40 
GeneralRe: Include order issues Pin
__DanC__6-May-09 11:00
__DanC__6-May-09 11:00 
GeneralRe: Include order issues Pin
Stuart Dootson6-May-09 11:14
professionalStuart Dootson6-May-09 11:14 
Pointers are good.

An alternative is to use the pimpl idiom[^]:

// a.h

class A
{
   A();
   // Stuff
private:
   struct A_impl;
   A_impl* impl_;
};

// b.h

class B
{
   B();
   // Stuff
private:
   struct B_impl;
   B_impl* impl_;
};

// a.cpp
#include "a.h"
#include "b.h"
struct A::A_impl
{
   B b;
};

A::A() : impl_(new A_impl) {}

// b.cpp
#include "b.h"
#include "a.h"
struct B::B_impl
{
   A a;
};

B::B() : impl_(new B_impl) {}


In either case, you need to take care with copy constructors and assignment operators.

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: Include order issues Pin
__DanC__6-May-09 21:06
__DanC__6-May-09 21:06 
Questionhelp extracting data Pin
dunlapjw6-May-09 7:42
dunlapjw6-May-09 7:42 
AnswerRe: help extracting data Pin
Madhu Nair6-May-09 8:41
Madhu Nair6-May-09 8:41 
QuestionRe: help extracting data Pin
David Crow6-May-09 8:42
David Crow6-May-09 8:42 
QuestionByte alignement - qt Pin
yaronillouz6-May-09 7:21
yaronillouz6-May-09 7: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.