This is my code. Help me
Code:
#include<afxwin.h>
#include<afxext.h>
#include"resource.h"
//////////////////////////////////////////////////////////////////////////////////////////////
class  CD : public CDocument
{
	DECLARE_DYNCREATE( CD )

public:
	CD():CDocument()
	{ 
	}
};
IMPLEMENT_DYNCREATE( CD, CDocument )
//////////////////////////////////////////////////////////////////////////////////////////////
class  CV : public CView
{
	
	DECLARE_DYNCREATE( CV )

public:
	
	void OnDraw(CDC* pDC)
	{
	}
};
IMPLEMENT_DYNCREATE( CV, CView )
class Dlg : public CDialog
{
public:
	Dlg(UINT  id):CDialog(id){}
	BOOL OnInitDialog()
	{
		CListBox wndListBox;
		wndListBox.Attach (GetDlgItem (IDC_LIST1)->m_hWnd);
		wndListBox.AddString (_T ("One"));
		wndListBox.AddString (_T ("Two"));
		wndListBox.AddString (_T ("Three"));
		wndListBox.Detach ();
		return true;
		
	}
                void CallDialog()
               {
                               Dlg d1(IDD_DLTEST1);
                               d1.DoModal();
               }
	DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(Dlg,CDialog)
	ON_COMMAND(IDOK, CallDialog)
END_MESSAGE_MAP()
class  CS : public CFrameWnd
{
	DECLARE_DYNCREATE( CS )
	CToolBar   tb;
	CStatusBar   sb;
public:
void OnCreate(LPCREATESTRUCT   cs)
	{
		CFrameWnd::OnCreate(cs);
		sb.Create(this);
		tb.Create(this);
		tb.LoadToolBar(IDR_MNTB);
		tb.EnableDocking( CBRS_ALIGN_ANY );
		EnableDocking( CBRS_ALIGN_ANY );
		DockControlBar( &tb );
	}
               BOOL CS::PreCreateWindow(CREATESTRUCT& cs)
               {
               }
	DECLARE_MESSAGE_MAP()
};
IMPLEMENT_DYNCREATE( CS, CFrameWnd )
BEGIN_MESSAGE_MAP( CS, CFrameWnd )
	
	ON_WM_CREATE()

END_MESSAGE_MAP()
//////////////////////////////////////////////////////////////////////////////////////////////
class  CT : public CWinApp
{
public:
	BOOL  InitInstance()
	{
		CSingleDocTemplate  *pd = new CSingleDocTemplate(
			IDR_MNTB,
			RUNTIME_CLASS( CD ),
			RUNTIME_CLASS( CS ),
			RUNTIME_CLASS( CV ));
		AddDocTemplate(pd);
		
		CCommandLineInfo  cf;
		ParseCommandLine(cf);
		if (!ProcessShellCommand(cf)) return false;
		return true;
	}
	
	DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(CT,CWinApp)
	ON_COMMAND( ID_EXIT, CWinApp::CloseAllDocuments)
END_MESSAGE_MAP()
//////////////////////////////////////////////////////////////////////////////////////////////
CT a;