Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OLE Objects in Rich Edit control

74 views
Skip to first unread message

Dmitry Streblechenko (MVP)

unread,
Apr 10, 2004, 3:24:07 AM4/10/04
to
Does anybody have any experience with the EN_OBJECTPOSITIONS notification
message?
I am trying to load an RTF containing the "\objattph" placeholder into an
RTF control.
According to the docs, I need to
1. Send EM_SETEVENTMASK specifying at least ENM_OBJECTPOSITIONS bit to make
sure the control parent will receive the (WM_NOTIFY, EN_OBJECTPOSITIONS)
message
2. Send EM_SETOLECALLBACK passing my implementation of the
IRichEditOleCallback interface
3. Stream the data in using EM_STREAMIN and SF_RTF
4. During the streaming the control will send (WM_NOTIFY,
EN_OBJECTPOSITIONS) to the control parent once it encounters the "\objattph"
placeholder.

I do indeed receive the EN_OBJECTPOSITIONS notification and I return the #
of objects and a pointer to an array of ULONGs in the OBJECTPOSITIONS
structure pointed to by LParam.
Am I mistaken in believing that the RTF control will then use my
implementation of the IRichEditOleCallback interface set in #2 to get the
actual IStorage data? - Nothing really happens: I get no callbacks and the
loaded RTF has the "\objattph" tag replaced with "\par" rather than the
actual data that I am supposed to supply.

Any ideas? I am really puzzled...

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Henry Skoglund

unread,
Apr 11, 2004, 8:28:09 PM4/11/04
to
"Dmitry Streblechenko (MVP)" <dmi...@dimastr.com> wrote in message
news:%23$jNPzsHE...@TK2MSFTNGP11.phx.gbl...
...

> Am I mistaken in believing that the RTF control will then use my
> implementation of the IRichEditOleCallback interface set in #2 to get the
> actual IStorage data? - Nothing really happens: I get no callbacks and the
> loaded RTF has the "\objattph" tag replaced with "\par" rather than the
> actual data that I am supposed to supply.

While I have not tried your exact RTF flavor, I can tell you, though, that
the IRichEditOleCallback does call your code back. In our project we use
a lot of embedded "{\pict\wmetafile8\.." pictures in the RTFs, and for them
to be displayed properly when using EM_STREAMIN, I have to return
a freshly initialized IStorage pointer to the richedit control when it calls
the GetNewStorage() method. I just return E_NOTIMPL in the other
9 methods, except for QueryInsertObject(), where I return S_OK.

Rgrds Henry


Dmitry Streblechenko (MVP)

unread,
Apr 14, 2004, 8:37:26 PM4/14/04
to
Hmmm... Do you handle (WM_NOTIFY, EN_OBJECTPOSITIONS) notifications in your
code?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"Henry Skoglund" <drt...@tungware.com> wrote in message
news:el8WMUCI...@tk2msftngp13.phx.gbl...

0 new messages