Click here to Skip to main content
15,914,488 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: urgent Pin
john563218-Mar-08 0:29
john563218-Mar-08 0:29 
GeneralRe: urgent Pin
fat_boy18-Mar-08 2:47
fat_boy18-Mar-08 2:47 
GeneralInheritance in Pimpl idiom Pin
George_George17-Mar-08 19:31
George_George17-Mar-08 19:31 
GeneralRe: Inheritance in Pimpl idiom Pin
Maxwell Chen17-Mar-08 20:01
Maxwell Chen17-Mar-08 20:01 
GeneralRe: Inheritance in Pimpl idiom Pin
George_George17-Mar-08 22:01
George_George17-Mar-08 22:01 
AnswerRe: Inheritance in Pimpl idiom [modified] Pin
Maxwell Chen17-Mar-08 20:43
Maxwell Chen17-Mar-08 20:43 
GeneralRe: Inheritance in Pimpl idiom Pin
George_George17-Mar-08 22:14
George_George17-Mar-08 22:14 
AnswerRe: Inheritance in Pimpl idiom Pin
Maxwell Chen17-Mar-08 23:00
Maxwell Chen17-Mar-08 23:00 
George_George wrote:
why do you want to call Bar and Pimpl in method Test of class Y? If we put something (like Bar) in Pimpl part, it means it is not visible. So, I think it does not make senses to access Bar if it is in Pimpl part. Any comments?


My code sample was just sort of excerpt. After all, you have to deal with class X or class Y in real life.

Let's take CDialog::OnInitDialog() of MFC for example. You created a dialog based project, so you have the below code.

In function implementation of CTestDlg::OnInitDialog, you need to do many things. For example: calling the base's member function CWnd::GetSystemMenu() to manipulate the title-box menu; calling CWnd::SetIcon to manipulate icons, etc.
class CTestDlg : public CDialog  // class Y : public X
{
protected:
  virtual BOOL OnInitDialog(void);
  // ...
};
BOOL CTestDlg::OnInitDialog()
{
  // ...
  CMenu* pMenu = GetSystemMenu(FALSE); // This is something like invoking X::Bar().
  // ...
}


The article and I are not talking it making sense or not to access Bar if it is moved into Pimpl; We are talking about: Sometimes a certain design paradigm will shoot your own feet.



George_George wrote:
I think you can still access Foo in class Y, right?


See my answer to (1) as the above.


My questions to you:
1) George, are you still at school or are you working at some company?
2) After you have been asking various beginner ~ expert level questions, do you really feel you are getting better in C++?
3) Are the questions you have asked here really useful to your homework or your real-world job?

  Maxwell Chen

GeneralRe: Inheritance in Pimpl idiom Pin
George_George17-Mar-08 23:26
George_George17-Mar-08 23:26 
GeneralRe: Inheritance in Pimpl idiom Pin
Maxwell Chen17-Mar-08 23:53
Maxwell Chen17-Mar-08 23:53 
GeneralRe: Inheritance in Pimpl idiom Pin
George_George18-Mar-08 0:17
George_George18-Mar-08 0:17 
GeneralCopy File and long file path Pin
vikramlinux17-Mar-08 19:26
vikramlinux17-Mar-08 19:26 
GeneralRe: Copy File and long file path Pin
Michael Dunn17-Mar-08 19:45
sitebuilderMichael Dunn17-Mar-08 19:45 
GeneralRe: Copy File and long file path Pin
vikramlinux17-Mar-08 20:23
vikramlinux17-Mar-08 20:23 
Questionshutdown function for CWinApp() Pin
rp_suman17-Mar-08 18:49
rp_suman17-Mar-08 18:49 
GeneralRe: shutdown function for CWinApp() Pin
rp_suman17-Mar-08 18:53
rp_suman17-Mar-08 18:53 
GeneralRe: shutdown function for CWinApp() Pin
Rajkumar R17-Mar-08 21:37
Rajkumar R17-Mar-08 21:37 
GeneralRe: shutdown function for CWinApp() Pin
rp_suman18-Mar-08 4:30
rp_suman18-Mar-08 4:30 
QuestionChange writing direction in RUN TIME (Edit Box) Pin
Joseph Marzbani17-Mar-08 9:50
Joseph Marzbani17-Mar-08 9:50 
GeneralRe: Change writing direction in RUN TIME (Edit Box) Pin
CPallini17-Mar-08 9:53
mveCPallini17-Mar-08 9:53 
GeneralRe: Change writing direction in RUN TIME (Edit Box) Pin
David Crow17-Mar-08 10:57
David Crow17-Mar-08 10:57 
GeneralRe: Change writing direction in RUN TIME (Edit Box) Pin
led mike17-Mar-08 11:39
led mike17-Mar-08 11:39 
Questionbackground worker Pin
Adnan Merter17-Mar-08 8:00
Adnan Merter17-Mar-08 8:00 
GeneralRe: background worker Pin
Chris Losinger17-Mar-08 8:11
professionalChris Losinger17-Mar-08 8:11 
GeneralRe: background worker Pin
led mike17-Mar-08 9:25
led mike17-Mar-08 9:25 

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.