--- In [email protected], "Sheri" <sheri...@...> wrote: > > --- In [email protected], "swzoh" <seanzoh@> wrote: > > > > --- In [email protected], "Sheri" <sherip99@> wrote: > > > > > > Any idea how I can access and use the Text Object Model interface > > > for a richedit control? It is obtained as a pointer to a pointer > > > in the lparam of EM_GETOLEINTERFACE sendmessage. The message does > > > succeed (gets a non-zero return value) but what next? > > > > I highly doubt you can use it out-of-process, as you said you > > obtained it via ReadProcessMemory/WriteProcessMemory. The only > > way I'm aware is using AccessibleObjectFromWindow with > > OBJID_NATIVEOM. You may ask Alan to wrap it into com plug-in. > > To use the TOM interface with an out-of-process control, somehow you're > supposed to use CoMarshalInterface and CoUnmarshalInterface. >
Those are not supposed to be called arbitrarily by an user, which is pointless anyway. > The reason I want the TOM interface is because it has a method for grouping a > bunch of edits into one undo action (BeginEditCollection, EndEditCollection). > I haven't found another way to do that. It would also be useful for an > in-process richedit control. > As I said, use AccessibleObjectFromWindow and call the functions via VTable as I did with IActiveDesktop, until Alan wraps into com.dll. AccessibleObjectFromWindow(hwndRichEdit, OBJID_NATIVEOM, IID_ITextDocument, pobj) ... ...
