Discussion:
Why return OLE_E_INVALIDRECT?
(too old to reply)
firefox
2010-06-13 08:46:13 UTC
Permalink
I use richedit text service as the attached.

Why wen I call TxSendMessage, the return value is OLE_E_INVALIDRECT?

Anyone can help me? Thanks a lot.

int CRichDrawText::CharFromPos(POINT pt)
{
LRESULT lres;

HRESULT hr;
POINT ptTemp = { 0 };

LPARAM lParam = MAKELPARAM(pt.x, pt.y);

LONG lPos;
m_TextServ->OnTxUIActivate();
m_TextServ->TxGetBaseLinePos(&lPos);
hr = m_TextServ->TxSendMessage(EM_CHARFROMPOS, 0, lParam, &lres);
return lres;
}
Leo Davidson
2010-06-13 14:47:26 UTC
Permalink
Post by firefox
I use richedit text service as the attached.
Why wen I call TxSendMessage, the return value is OLE_E_INVALIDRECT?
 LPARAM lParam = MAKELPARAM(pt.x, pt.y);
Your lParam argument is the wrong type for a richedit control. See the
documentation on the message you are sending:

http://msdn.microsoft.com/en-us/library/bb761566%28VS.85%29.aspx
firefox
2010-06-17 01:28:02 UTC
Permalink
It is unuseful, even I pass the poiner to the lparam, still return
OLE_E_INVALIDRECT.
Post by firefox
I use richedit text service as the attached.
Why wen I call TxSendMessage, the return value is OLE_E_INVALIDRECT?
LPARAM lParam = MAKELPARAM(pt.x, pt.y);
Your lParam argument is the wrong type for a richedit control. See the
documentation on the message you are sending:

http://msdn.microsoft.com/en-us/library/bb761566%28VS.85%29.aspx

Loading...