// JP opened flex table

Click to See Complete Forum and Search --> : Accelerators in Active Document Server


Colt
November 6th, 2000, 10:00 AM
I have problems implementing accelerators for an inplace activated Active Doc. Server.

To reproduce the error:
Create an Active Document Server with the App. Wizard. Select a view based on CFormView. After generation add some push buttons with accelerators to the CFormView. Add some default handlers to the buttons. Start application standalone and test accelerators. (It should work).

Start the application embedded in an Active Document Container (e.g. Office Binder) => The accelerators won't work.

This problem is very urgent for me. The problem seems to be in the following code of the MFC:

BOOL COleIPFrameWnd::PreTranslateMessage(MSG* pMsg)
{
// check server's accelerators first
if (CFrameWnd::PreTranslateMessage(pMsg))
return TRUE;

if (pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST)
{
// always check to see if they exist in the default accel table
// (they may exist but not be translated when disabled)
HACCEL hAccel = GetDefaultAccelerator();
if (hAccel != NULL && IsAccelerator(hAccel,
CopyAcceleratorTable(hAccel, NULL, 0), pMsg, NULL))
{
return TRUE;
}

// check container's accelerators as last chance
OLEINPLACEFRAMEINFO frameInfo = m_frameInfo;
if (::OleTranslateAccelerator(m_lpFrame, &frameInfo, pMsg) == S_OK)
return TRUE;
}

return FALSE; // keystroke not processed.
}


::OleTranslateAccelerator() always returns S_OK, so that the CFormView gets no chance to translate the accelerator.

Has anybody out there an idea?
Thanx for any hint

Rakesh Nassa
May 1st, 2001, 05:57 AM
Hi..
I have encountered the same sort of problem . In AciveX Document server view which is inherited from CFormView , the Container accelerator are not responding .Otherwise in other active X documents which are inherited from other view class . It is working fine. I think , you have encountered this problem long ago , if you got any soultion todate , Please send me..
Thanks


raka

//JP added flex table