[Accessibility-ia2] IEnumVARIANT vs arrays

James Teh jamie at nvaccess.org
Mon Mar 5 20:57:41 UTC 2012


On 6/03/2012 2:27 AM, Pete Brunet wrote:
> HRESULT IAccessible2_2::targetsByRelationType (
>    [in] BSTR type,
>    [out, size_is(,*nTargets)] long **targets,
>    [out, retval] long *nTargets )
> This does not have the extra [in] count parameter Jamie proposed so the
> client doesn't need to know before the call how many targets there are.
As I explained before, the point of the requestedTargets count parameter 
I proposed was to allow the client to only retrieve the first n targets 
if desired. As I noted, if requestedTargets is 0, the client is 
requesting all relations, so the client doesn't need to know how many 
targets there are in advance. nTargets always returns the number of 
targets in the array, so if requestedTargets > nTargets, it doesn't 
matter; the client should just use nTargets always once the call returns.

So, to get just the first target, a client would call with 
requestedTargets=1. If there are no targets, nTargets would be 0 and the 
targets array would be empty or NULL. If there is at least one target, 
nTargets would be 1 and the targets array would contain one entry.

Jamie

-- 
James Teh
Director, NV Access Limited
Email: jamie at nvaccess.org
Web site: http://www.nvaccess.org/
Phone: +61 7 5667 8372


More information about the Accessibility-ia2 mailing list