Hi All
I am developing the project. it is MDI based derived from CScrollView class. i am giving some code frame mainframe class..
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
CWinApp * pApp = ::AfxGetApp();
ASSERT( pApp != NULL );
ASSERT( pApp->m_pszRegistryKey != NULL );
ASSERT( pApp->m_pszRegistryKey[0] != _T(’\0’) );
ASSERT( pApp->m_pszProfileName != NULL );
ASSERT( pApp->m_pszProfileName[0] != _T(’\0’) );
ASSERT( pApp->m_pszProfileName != NULL );
g_CmdManager->ProfileSetup(
pApp->m_pszProfileName,
GetSafeHwnd()
);
VERIFY(
g_CmdManager->UpdateFromMenu(
pApp->m_pszProfileName,
IDR_MAINFRAME
)
);
VERIFY(
g_CmdManager->UpdateFromMenu(
pApp->m_pszProfileName,
IDR_MYPAINTYPE
)
);
VERIFY(
g_CmdManager->UpdateFromToolBar(
pApp->m_pszProfileName,
IDR_TOOLBAR2
)
);
if( !m_wndToolBar.Create(
NULL,
this,
AFX_IDW_TOOLBAR
)
||
!m_wndToolBar.LoadToolBar(IDR_TOOLBAR)
)
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
and in CPP class in InitInstance method...
AfxEnableControlContainer ();
// <dave> dump memory leaks
#ifdef _DEBUG
_CrtDumpMemoryLeaks();
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif
// Standard initialization
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
// SetRegistryKey( _T("NetSoft") );
SetupUiAdvancedOptions();
LoadStdProfileSettings(5);
// Register the application’s document templates. Document templates
// serve as the connection between documents, frame windows and views.
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_MYPAINTYPE,
RUNTIME_CLASS(CMyPaintDoc),
RUNTIME_CLASS(CChildFrame), // main SDI frame window
RUNTIME_CLASS(CMyPaintView));
demoTemplate = pDocTemplate;
m_DocTemplate = pDocTemplate;//test
AddDocTemplate(pDocTemplate);
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME)) return FALSE;
m_pMainWnd = pMainFrame;
when i debug my application i found null handler of mainframe exact this line if (!pMainFrame->LoadFrame(IDR_MAINFRAME)) return FALSE; i am using these classes
CExtToolControlBar m_wndToolBar;
CExtMenuControlBar m_wndMenuBar;
CExtStatusControlBar m_wndStatusBar;
can any body heelp me.
thanks in advanced.