Reworked CXTPShortcutManager to allow double key combinations, Format\SetAccel method now requires the CXTPShortcutManagerAccel parameter. Pass CXTPShortcutManagerAccel class to the Format\SetAccel method to fix error.
The following is a sample that shows how to work with the new classes:
CXTPShortcutManagerAccelTable* pAccelTable = GetCommandBars()->GetShortcutManager()->GetDefaultAccelerator();
int nAccelSize = pAccelTable ->GetCount();
for (int i = 0; i < nAccelSize; i ++)
{
CXTPShortcutManagerAccel* accel = pAccelTable->GetAt(i);
CString strKey =GetCommandBars()->GetShortcutManager()->Format(accel, NULL);
}
Below are some scenarios that you might need to fix in your code:
Example 1 - Variable declared in Header File:
Previous versions header file: LPACCEL m_lpAccel; 12.0.0 and higher versions header file: CXTPShortcutManagerAccel* m_lpAccel; Previous versions cpp file: if (m_lpAccel)
{
m_wndAccel.SetAccel(*m_lpAccel);
}12.0.0 and higher versions cpp file: if (m_lpAccel)
{
m_wndAccel.SetAccel(m_lpAccel);
}
Example 2 - Variable declared in CPP File:
Previous versions cpp file: m_lpAccel = new ACCEL [m_nAccelSize]; 12.0.0 and higher versions cpp file: m_lpAccel = new CXTPShortcutManagerAccel [m_nAccelSize];
Example 3:
Previous versions cpp file:
m_lpAccel = new ACCEL [m_nAccelSize];
::CopyAcceleratorTable (hAccelTable, m_lpAccel, m_nAccelSize);
12.0.0 and higher versions cpp file:
int m_nAccelSize = pAccelTable->GetCount();
for (int i = 0; i < nAccelSize; i ++)
{
m_lpAccel[i] = m_pAccelTable->GetAt ( i );
}
|