Class problem in C++

This is a discussion on Class problem in C++ within the Windows Programming forums, part of the Platform Specific Boards category; Code: #include <afxwin.h> #include "Resource.h" class DialogApp : public CWinApp { public: BOOL InitInstance(); }; class CExoDialog : public CDialog ...

  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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    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
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

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, 08: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, 12:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21