Ok, tell me please when the menthoned release will be chiped?
Here are some parts of source code about second problem:
Suppose that
class CMainFrame : public CMDIFrameWnd
{
...
typedef map <LONG, CExtPanelControlBar*> CDealControlBars;
CDealControlBars m_mapCP2DealDockedWnds;
...
};
This method creates dynamic control bars and corresponding commands from registry’s data:
void CMainFrame::LoadNonMDIDealWndsState(const CString& strLogin)
{
if (!strLogin.IsEmpty())
{
try
{
CMemFile file;
CTTApp* pApp = static_cast<CTTApp*>(AfxGetApp());
CString strRegKeyPath = ...
if (CExtCmdManager::FileObjFromRegistry(file, strRegKeyPath))
{
CArchive ar(&file, CArchive::load);
int nCount = 0;
ar >> nCount;
LONG nCPID = 0;
UINT nChildID = 0;
CString strDealWnd((LPCSTR)IDS_DEAL_WINDOW);
for (int i = 0; i < nCount; ++i)
{
ar >> nCPID;
ar >> nChildID;
CString caption;
CExtPanelControlBar* pControlBar = new CExtPanelControlBar;
pControlBar->m_bAutoDelete = TRUE;
if( !pControlBar->Create(
caption,
this,
nChildID,
WS_CHILD
|CBRS_LEFT|CBRS_GRIPPER|CBRS_TOOLTIPS
|CBRS_FLYBY|CBRS_SIZE_DYNAMIC
|CBRS_HIDE_INPLACE|CBRS_FLOAT_MULTI
)
)
{
CString strFormat(_T("CMainFrame::LoadNonMDIDealWndsState: Failed to create deal control bar, CPID is %d"));
CString strMsg;
strMsg.Format(strFormat, nCPID);
ReportInternalError(strMsg);
continue;
}
bool bSuccess = false;
CDealView* pView = (CDealView*)RUNTIME_CLASS(CDealView)->CreateObject();
if (pView)
{
CCreateContext context;
context.m_pCurrentFrame = NULL;
context.m_pCurrentDoc = NULL;
context.m_pNewViewClass = NULL;
context.m_pNewDocTemplate = NULL;
context.m_pLastView = NULL;
if (pView->Create(NULL, NULL, WS_CHILD | WS_VISIBLE, m_rcDealView, pControlBar, AFX_IDW_PANE_FIRST, &context))
{
pView->ModifyStyleEx(0, WS_EX_CLIENTEDGE, SWP_FRAMECHANGED | SWP_DRAWFRAME);
m_mapCP2DealWindow.insert(make_pair(nCPID, pView));
pView->SetCPID(nCPID);
pView->Dock();
bSuccess = true;
}
}
if (bSuccess)
{
CExtCmdItem cmdBar;
cmdBar.m_nCmdID = nChildID;
cmdBar.m_sMenuText = _T(" - ") + strDealWnd;
g_CmdManager->CmdSetup(
__PROF_UIS_PROJECT_CMD_PROFILE_NAME,
cmdBar,
true,
NULL);
m_mapCP2DealDockedWnds.insert(make_pair(nCPID, pControlBar));
pControlBar->EnableDocking(CBRS_ALIGN_ANY);
m_ctrlBarChildIDGenerator.ExcludeValue(nChildID);
}
else
{
pControlBar->DestroyWindow();
}
}
}
}
catch(...)
{
}
}
}
And this method modifies "View" submenu of the main menu:
LRESULT CMainFrame::OnExtMenuPrepare(WPARAM wParam, LPARAM lParam)
{
CExtPopupMenuWnd::MsgPrepareMenuData_t* pData = reinterpret_cast<CExtPopupMenuWnd::MsgPrepareMenuData_t*>(wParam);
ASSERT (pData != NULL);
CExtPopupMenuWnd* pPopup = pData->m_pPopup;
ASSERT (pPopup != NULL);
INT nReplacePos = pPopup->ItemFindPosForCmdID(ID_LIST_OF_ALL_BARS);
if (nReplacePos >= 0)
{
VERIFY(pPopup->ItemRemove(nReplacePos));
if (!m_mapCP2DealDockedWnds.empty())
{
if (pPopup->ItemInsert((UINT)CExtPopupMenuWnd::TYPE_SEPARATOR))
{
for (CDealControlBars::iterator bar_it = m_mapCP2DealDockedWnds.begin(); bar_it != m_mapCP2DealDockedWnds.end(); ++bar_it)
{
pPopup->ItemInsert(bar_it->second->GetDlgCtrlID()))
}
}
}
}
return TRUE;
}
What I need to correct? Or You need more source code?