Thread: Class problem in C++

  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    2

    Question Class problem in C++

    Code:
    #include <afxwin.h>
    #include "Resource.h"
    
    class DialogApp : public CWinApp
    {
    public:
    	BOOL InitInstance();	
    };
    
    class CExoDialog : public CDialog
    {
    public:
    	enum { IDD = IDD_DIALOG1 };
    
    	CExoDialog();
    };
    
    CExoDialog::CExoDialog()
    	: CDialog(CExoDialog::IDD, NULL)
    {
    }
    
    BOOL DialogApp::InitInstance()
    {	
    	CExoDialog Dlg;
    	m_pMainWnd = &Dlg;
    	Dlg.DoModal();
    
    	return TRUE;
    };
    
    DialogApp theApp;
    
    //End of test31.CPP
    I don't understand meaning of the following code. Please give some explain. Thanks indeed.

    Code:
    CExoDialog::CExoDialog()
    	: CDialog(CExoDialog::IDD, NULL)
    {
    }

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,794
    CExoDialog class has a base class - CDialog

    CExoDialog default constructor calls the base class constructor with 2 parameters
    first - is resourse ID of the dialog to use (which is IDD_DIALOG1 ), second is NULL
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Mesh Class Design problem
    By sarah22 in forum Game Programming
    Replies: 2
    Last Post: 05-20-2009, 04:52 AM
  2. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  3. Class design problem
    By h3ro in forum C++ Programming
    Replies: 10
    Last Post: 12-19-2008, 09:10 AM
  4. My Window Class
    By Epo in forum Game Programming
    Replies: 2
    Last Post: 07-10-2005, 02:33 PM
  5. Replies: 3
    Last Post: 12-03-2001, 01:45 PM