--- In [email protected], "entropyreduction" 
<alancampbelllists+ya...@...> wrote:
>
> --- In [email protected], "swzoh" <seanzoh@> wrote:
> 
> > objTom = com.AccessibleObjectFromWindow(hwndRichEdit, OBJID_NATIVEOM, 
> > IID_IDispatch) ;; the third parameter can be optional, defaultly set to 
> > IID_IDispatch
> > objTom.BeginEditCollection()
> 
> I hadn't run into AccessibleObjectFromWindow before. 
> 
> http://msdn.microsoft.com/en-us/library/dd317978%28VS.85%29.aspx
> 
> says "To obtain an IDispatch interface pointer to a class supported by the 
> native object model, specify OBJID_NATIVEOM in dwObjectID. When using this 
> object identifier, the hwnd parameter must match the following window class 
> types."  And then goes on to list only a few Office windows classes.  But 
> it's your understanding that this would also work for other window classes?  
> If so, is there a way of determining which window class will return which 
> interface type?
> In particular that applied to a rich edit control it will return a 
> IRichEditOle?

I had seen that too, but looking here:

<http://www.lw-tech.com/q1/ug_accessibility.htm>

I see richedit (richedit20w in the example) also associated with 
OBJID_NATIVEOM. Elsewhere I saw richedit20a and richedit50 variants mentioned, 
can't find at the moment.

Above link is referencing Active Accessibility SDK; don't know how 
AccessibleObjectFromWindow fits into that.

I have struggled without solving how to get an interface pointer using 
AccessibleObjectFromWindow from Oleacc.dll via the dll plugin. My code crashes 
Powerpro (is run with dialog general viewer richedit open and global 
RE_TEST_HWND set to the control's hwnd). The error says something like the 
memory at the referenced address couldn't be written.

local dll_status
local pobj=dll.create_struct("LPSTR")  ;; Oleacc.dll
local ppobj=dll.get_pointer(pobj)
;iTextDocument iid
local a1=0x8CC497C0
local w1=0xA1DF
local w2=0x11CE
local by=binary.empty(8)
by[1]=binary.from_hex("80")
by[2]=binary.from_hex("98")
by[3]=binary.from_hex("00")
by[4]=binary.from_hex("AA")
by[5]=binary.from_hex("00")
by[6]=binary.from_hex("47")
by[7]=binary.from_hex("BE")
by[8]=binary.from_hex("5D")
local dispatch=0xFFFFFFF0
local guid=dll.create_struct("dword word word x[8]", a1, w1, w2, by)
local tdi = dll.call("Oleacc|AccessibleObjectFromWindow|i i t lpstr", 
RE_TEST_HWND, dispatch, "guid", ppobj)

Regards,
Sheri

Reply via email to