Re: Can't get OLE interface



At what point are you calling this? Are you sure the m_ctlRichText.m_hWnd is a valid
window handle? Otherwise it looks like it should work, given the article.

Otherwise, I'm as stuck as you are.
joe


On Wed, 16 Apr 2008 16:26:37 -0700 (PDT), Nemo <nnimod@xxxxxxxxx> wrote:

Hi. I am trying to insert an image into a RichEditCtrl, and was
following the code provided at MSDN KB 220844.
I seem to be getting stuck right at the first step. The assert
following the SendMessage always fails :

::SendMessage(m_ctlRichText.m_hWnd, EM_GETOLEINTERFACE, 0,
(LPARAM)&m_pRichEditOle);
ASSERT(m_pRichEditOle != NULL);

I tried to look up on MSDN, but I can't seem to find any documentation
as to why the attempt to get the interface might fail. Yet. I have a
funny feeling it is some initialization call that I must be missing.

btw, I do call AfxInitRichEdit(). I even stuck in a AfxOleInit() to be
sure.

I even tried using the GetIRichEditOle() method. But the same result -
I got back a null pointer.

Any insight, I'm sure, would be handy.

Thanks,
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Cant get OLE interface
    ... I am trying to insert an image into a RichEditCtrl, ... I seem to be getting stuck right at the first step. ... following the SendMessage always fails: ... I tried to look up on MSDN, but I can't seem to find any documentation ...
    (microsoft.public.vc.mfc)
  • Re: Cant get OLE interface
    ... I seem to be getting stuck right at the first step. ... following the SendMessage always fails: ... I tried to look up on MSDN, but I can't seem to find any documentation ... as to why the attempt to get the interface might fail. ...
    (microsoft.public.vc.mfc)
  • Re: Network Drive Issue
    ... It was stuck too. ... > Open DOS box and tried to switch drives: ... > At some point the DOS window showed the S: ...
    (microsoft.public.win32.programmer.kernel)
  • Re: saved my hotmail password by mistake
    ... I accidentally clicked yes when a pop up window ... > came up asking me to save hotmail password. ... > stuck with my password being saved and many people use ... tab click on AutoComplete, and then Clear passwords. ...
    (microsoft.public.security)
  • Re: whats a "std::_Container_base::_Orphan_all"
    ... Some of my thread gets stuck somewhere. ... debugging "Thread" window shows that stuck thread and I can I dentify it. ... SendMessage api, which I'm sending to my GUI window, and this call never ...
    (microsoft.public.dotnet.languages.vc)