The MASM Forum

General => The Workshop => Windows API => Topic started by: jj2007 on January 04, 2023, 08:39:07 PM

Title: ITextDocument.GetRange
Post by: jj2007 on January 04, 2023, 08:39:07 PM
ITextDocument.GetRange(Int32, Int32) Method (https://learn.microsoft.com/en-us/uwp/api/windows.ui.text.itextdocument.getrange?view=winrt-22621#windows-ui-text-itextdocument-getrange(system-int32-system-int32))

Pretty clear, but GetRange does not appear in my Tom.h header. Have they changed the TOM interfaces in recent Windows versions?
Title: Re: ITextDocument.GetRange
Post by: HSE on January 04, 2023, 11:28:25 PM
windows.ui.text.h
Title: Re: ITextDocument.GetRange
Post by: jj2007 on January 05, 2023, 12:59:09 AM
https://github.com/tpn/winsdk-10/blob/master/Include/10.0.14393.0/winrt/windows.ui.text.h (https://github.com/tpn/winsdk-10/blob/master/Include/10.0.14393.0/winrt/windows.ui.text.h)

namespace ABI {
    namespace Windows {
        namespace UI {
            namespace Text {
                interface ITextDocument;
            } /* end namespace */
        } /* end namespace */
    } /* end namespace */
} /* end namespace */

...

#define __x_ABI_CWindows_CUI_CText_CITextDocument_GetText(This,options,value)    \
    ( (This)->lpVtbl -> GetText(This,options,value) )

Tom.h:
#define ITextRange_GetText(This,pbstr)    \
    (This)->lpVtbl -> GetText(This,pbstr)

Same name, different arg list. Congrats, Micros*t :thumbsup:
Title: Re: ITextDocument.GetRange
Post by: HSE on January 05, 2023, 01:09:43 AM
#define __x_ABI_CWindows_CUI_CText_CITextDocument_GetRange(This, startPosition, endPosition, result) \
    ((This)->lpVtbl->GetRange(This, startPosition, endPosition, result))
Title: Re: ITextDocument.GetRange
Post by: jj2007 on January 05, 2023, 01:13:11 AM
Quote from: HSE on January 05, 2023, 01:09:43 AM
#define __x_ABI_CWindows_CUI_CText_CITextDocument_GetRange(This, startPosition, endPosition, result) \
    ((This)->lpVtbl->GetRange(This, startPosition, endPosition, result))

Quote from: jj2007 on January 05, 2023, 12:59:09 AM
#define __x_ABI_CWindows_CUI_CText_CITextDocument_GetText(This,options,value) \
    ( (This)->lpVtbl -> GetText(This,options,value) )


Sure. Now the only problem is to get the Windows RT to work on Windows 7 :cool:
Title: Re: ITextDocument.GetRange
Post by: HSE on January 05, 2023, 01:20:40 AM
Quote from: jj2007 on January 05, 2023, 01:13:11 AM
Sure. Now the only problem is to get the Windows RT to work on Windows 7 :cool:

It's Win 10 kit.