XTPQuickAccessToobar will not save/load control |
Post Reply |
Author | |
Andrew Beardsley
Newbie Joined: 03 June 2016 Status: Offline Points: 2 |
Post Options
Thanks(0)
Posted: 03 June 2016 at 4:25pm |
I can r-click a custom control and add it to my Quick Access Toolbar. I can also add it through More Commands from the QAT dropdown. They work until i close and re-open the application. something is going horribly wrong with my save or load. The code below was borrowed from another Codejock user named Dan.
here is the Code i am using: /code Load: SaveLoadQAC(CFile::modeRead, CFile::shareExclusive, CArchive::load); Save: SaveLoadQAC(CFile::modeCreate, CFile::modeWrite, CArchive::store); void CESHAMainFrame::SaveLoadQAC(CFile::OpenFlags Flag1, CFile::OpenFlags Flag2,CArchive::Mode mode) { CFile fSettings; if (fSettings.Open(m_sSettingsFilePath, Flag1 | Flag2)) { CArchive ar(&fSettings, mode); CXTPPropExchangeArchive px(ar); CXTPRibbonQuickAccessControls *pQA = m_pRibbonBar->GetQuickAccessControls(); XTP_COMMANDBARS_PROPEXCHANGE_PARAM param; if (mode == CArchive::load) { param.pCommandBars = GetCommandBars(); } param.bSaveOnlyCustomized = FALSE; param.bLoadSilent = TRUE; param.bSaveOriginalControls = TRUE; param.bSerializeActions = TRUE; param.bSerializeControls = TRUE; param.bSerializeDesignerControls = TRUE; param.bSerializeImages = FALSE; param.bSerializeLayout = TRUE; param.bSerializeOptions = TRUE; px.m_dwData = DWORD_PTR(¶m); pQA->DoPropExchange(&px); ar.Close(); fSettings.Close(); } } ~Edit: So after some other defect fixes, i found that we were incorrectly using some xtpControlSplitButtonPopup controls and i changed them to xtpControlButtonPopup. This allowed the same buttons to be used and saved in the QAT. I have since removed the above method and i am now just calling: SaveCommandBars(_T("ESHACommandBar")); and LoadCommandBars(_T("ESHACommandBar")); ~Andrew |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |