Cursor/caret is not shown in an in-place CEdit-derived control

"izm_ka" <izm_ka-/[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
I'm converting an MFC application into WTL 8.1 and stuck with issues. The in-place control (see below) is working only once. If it looses focus and gets the focus back, cursor/caret is no longer visible; however, content can be changed by typing. Here is declaration of the in-place Edit control:
class CMyInPlaceEdit:  public CWindowImpl<CMyInPlaceEdit, CEdit>
{
public:
  CMyInPlaceEdit() : CWindowImpl<CMyInPlaceEdit, CEdit>() {}

  BOOL SubclassWindow(HWND hWnd)
  {
    return CWindowImpl<CMyInPlaceEdit, CEdit>::SubclassWindow(hWnd);
  }
BEGIN_MSG_MAP_EX(CMyInPlaceEdit)
  MESSAGE_HANDLER(WM_KILLFOCUS, OnKillFocus)
  MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
  MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
  <<<cut>>>
};

I create the in-place Edit:
m_edit = new CMyInPlaceEdit();
m_edit->Create(m_parent->m_hWnd, urect, NULL, WS_CHILD | ES_AUTOHSCROLL, 0, MenuOrID, 0);

LRESULT CMyInPlaceEdit::OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	///CEdit::OnLButtonDown(nFlags, point);
	::DefWindowProc(m_hWnd, uMsg, wParam, lParam);

	bHandled = FALSE;
	return 0;
}

LRESULT CMyInPlaceEdit::OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	///CEdit::OnSetFocus(pNewWnd);
	LRESULT lRet = ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);

	bHandled = FALSE;
	return lRet;
}

LRESULT CMyInPlaceEdit::OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
{
	///CEdit::OnKillFocus(pNewWnd);
	LRESULT lRet = ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);

	return lRet;
}

To hide/show the in-place Edit I use:
m_edit->ShowWindow(SW_HIDE);
and
m_edit->ShowWindow(SW_SHOW);
::SetFocus(m_edit->m_hWnd);

Please help...



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.