April 21st, 2012, 01:49 PM
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.
I do not understand the debug messages generated:
LONG CDialogBar1::OnInitDialog ( UINT wParam, LONG lParam)
BOOL bRet = HandleInitDialog(wParam, lParam);
TRACE0("Warning: UpdateData failed during dialog init.\n");
// TODO: Add extra initialization here
I have attached a demo XDBarDemo to illustrate the problem and serve as a basis for discussion.
Unhandled exception at 0x77ad15de in XDbar.exe 0xC015000F: The activation context being deactivated is not the most recently activated one.
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)
Any help greatly appreciated.
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!