Tech Support > Microsoft Windows > Development Resources > modifying an REOBJECT
modifying an REOBJECT
Posted by Force Code on May 22nd, 2008


A rich edit returns an IRichEditOle interface pointer via the message
EM_GETOLEINTERFACE. Then, you can call IRichEditOle::GetObject( LONG n,
REOBJECT* reobj, DWORD flags) to retrieve the REOBJECT for some image
embedded in the richedit. Does anyone know how to modify that reobject.
Specifically I want to change the dwUser field. The following does not work:

REOBJECT reobj = {sizeof(reobj)};
pRichEditOle->GetObject(0,&reobj,REO_GETOBJ_ALL_INTERFACES);
CHARRANGE cr = {reobj.cp,reobj.cp};
SendMessage(hwnd,EM_EXSETSEL,0,(LPARAM)&cr);
reobj.cp = REO_CP_SELECTION;
reobj.dwUser = n;
pRichEditOle->InsertObject(&reobj);


Posted by Christian ASTOR on May 24th, 2008


Force Code wrote:

I have tested ("riched20", XP SP2) and it works for me.
If I recall ::GetObject() with another REOBJECT, I get dwUser = n
(and you should test HRESULT...)


Similar Posts