--- In [email protected], "swzoh" <sean...@...> 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. 

Alan will be away for a couple weeks.

I haven't gotten the TOM interface working in process yet.

It was non-TOM EM sendmessages I did with a variable from WriteProcessMemory. 
For example I created a CHARFORMAT2 structure with a bunch of text effects set 
(bold, italic, color) and wrote it to another process. Then I messaged the 
richedit control in that process with a dll.get_pointer to that variable, and 
the effects got applied consistent with my structure.

To use the TOM interface with an out-of-process control, somehow you're 
supposed to use CoMarshalInterface and CoUnmarshalInterface.

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.

Regards,
Sheri

Reply via email to