-
April 21st, 2012, 01:49 PM
#1
How to get a working context menu on a dialog bar RichEditCtrl ?
I need to get a simple edit menu popup to work on a CRichEditCtrl window in a dialog bar. (VC 2010). I cannot figure out how to 'subclass' (if that is the correct term to use) the dialog bar text window in order to get the popup menu to work. I have tried to subclass the edit window on initialization of the dialog bar using but this invariably results in an appcrash.
Code:
LONG CDialogBar1::OnInitDialog ( UINT wParam, LONG lParam)
{
BOOL bRet = HandleInitDialog(wParam, lParam);
if (!UpdateData(FALSE))
{
TRACE0("Warning: UpdateData failed during dialog init.\n");
}
// TODO: Add extra initialization here
//GetDlgItem(IDC_EDIT_QUERY)->SubclassDlgItem(IDC_EDIT_QUERY, m_pRichEditEx);
//SubclassDlgItem(IDC_EDIT_QUERY, m_pRichEditEx);
return bRet;
}
I do not understand the debug messages generated:
Unhandled exception at 0x77ad15de in XDbar.exe 0xC015000F: The activation context being deactivated is not the most recently activated one.
afxcomctl32.h
AFX_ISOLATIONAWARE_STATICLINK_FUNC(HWND ,CreateWindowExW,(DWORD dwExStyle,LPCWSTR lpClassName,LPCWSTR lpWindowName,DWORD dwStyle,int X,int Y,int nWidth,int nHeight,HWND hWndParent,HMENU hMenu,HINSTANCE hInstance,LPVOID lpParam),(dwExStyle,lpClassName,lpWindowName,dwStyle,X,Y,nWidth,nHeight,hWndParent,hMenu,hInstance,lpParam),NULL)
I have attached a demo XDBarDemo to illustrate the problem and serve as a basis for discussion.
Any help greatly appreciated.
mpliam
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|