[Accessibility-ia2] IEnumVARIANT vs arrays

Pete Brunet pete at a11ysoft.com
Wed Mar 14 03:32:35 UTC 2012


It looks like there is agreement on a single method:

HRESULT IAccessible2_2::relationTargetsOfType (
  [in] BSTR type,
  [in] long maxTargets,  // 0 means get them all
  [out, size_is(,*nTargets)] IUnknown ***targets,
  [out, retval] long *nTargets  )  // # targets returned

On 3/13/12 9:49 PM, James Teh wrote:
> Hi.
> Personally, I don't mind which. However, one issue to consider is that
> having two methods increases the work (and potential for error) for
> server implementers. In contrast, retrieving a single relation via an
> array method, while perhaps a little less elegant, isn't particularly
> difficult for clients.
>
> Jamie
>
> On 14/03/2012 12:39 AM, Pete Brunet wrote:
>> In both cases there has been agreement on the first method (which will
>> be used the vast majority of the time):
>>
>> // Fetch one target, even if there is more than one.
>> HRESULT IAccessible2_2::relationTargetOfType (
>>    [in] BSTR type,
>>    [out, retvalue] IUnknown **target )
>>
>> But there have been two suggestions for a companion method to get more
>> than one relation:
>>
>> // Fetch all targets
>> HRESULT IAccessible2_2::relationTargetsOfType (
>>    [in] BSTR type,
>>    [out, size_is(,*nTargets)] IUnknown ***targets,
>>    [out, retval] long *nTargets  )  // # targets returned
>>
>> or
>>
>> // Fetch either a specified number of targets or
>> // all targets depending on the maxTargets parameter.
>> //
>> // maxTargets will typically be 1 or 0.
>> // If maxTargets is 0 all targets will be returned.
>> HRESULT IAccessible2_2::relationTargetsOfType (
>>    [in] BSTR type,
>>    [in] long maxTargets,
>>    [out, size_is(,*nTargets)] IUnknown ***targets,
>>    [out, retval] long *nTargets  )  // # targets returned
>>
>> Note: In both cases the server allocates the array.  The size of the
>> array is conveyed via nTargets.
>>
>> Pete
>

-- 
*Pete Brunet*
                                                                
a11ysoft - Accessibility Architecture and Development
(512) 467-4706 (work), (512) 689-4155 (cell)
Skype: pete.brunet
IM: ptbrunet (AOL, Google), ptbrunet at live.com (MSN)
http://www.a11ysoft.com/about/
Ionosphere: WS4G
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/accessibility-ia2/attachments/20120313/ed58b403/attachment.html>


More information about the Accessibility-ia2 mailing list