Any idea how to get this API to work?

Discussion in 'C++' started by codercode, Sep 4, 2007.

  1. codercode

    codercode Guest

    Private Declare Function AccessibleChildren Lib "oleacc" (ByVal
    paccContainer As IAccessible, _
    ByVal iChildStart As Integer, _
    ByVal cChildren As Integer, _
    ByVal rgvarChildren() As Object, _
    ByVal pcObtained As Integer) As UInteger

    Dim iTMP As Accessibility.IAccessible
    Dim lngTMP2 As Integer
    iTMP = lngTMP
    Dim lngCount As Integer
    lngCount = iTMP.accChildCount
    Dim Children(lngCount - 1) As Object

    Call AccessibleChildren(iTMP, 0, (lngCount - 1), Children(0), lngTMP2)

    I can't get the 'rgvarChildren' parameter correct.

    My code's translated from the following C# code:

    [DllImport("Oleacc.dll")]
    public static extern int AccessibleChildren(
    Accessibility.IAccessible paccContainer,
    int iChildStart,
    int cChildren,
    [Out] object[] rgvarChildren,
    out int pcObtained);

    int _ChildCount = IACurrent.accChildCount;
    object[] _Children = new object[_ChildCount];
    int _out;

    AccessibleChildren(IACurrent,0,_ChildCount-1,_Children,out _out);

    It doesn't work on VB 2005. An empty Children is returned.
    However, it does work on VB6 by declaring Children as a Variant. Any
    ideas?

    Thanks in advance
    codercode, Sep 4, 2007
    #1
    1. Advertising

  2. On 2007-09-04 18:28, codercode wrote:
    > Private Declare Function AccessibleChildren Lib "oleacc" (ByVal
    > paccContainer As IAccessible, _
    > ByVal iChildStart As Integer, _
    > ByVal cChildren As Integer, _
    > ByVal rgvarChildren() As Object, _
    > ByVal pcObtained As Integer) As UInteger
    >
    > Dim iTMP As Accessibility.IAccessible
    > Dim lngTMP2 As Integer
    > iTMP = lngTMP
    > Dim lngCount As Integer
    > lngCount = iTMP.accChildCount
    > Dim Children(lngCount - 1) As Object
    >
    > Call AccessibleChildren(iTMP, 0, (lngCount - 1), Children(0), lngTMP2)
    >
    > I can't get the 'rgvarChildren' parameter correct.
    >
    > My code's translated from the following C# code:
    >
    > [DllImport("Oleacc.dll")]
    > public static extern int AccessibleChildren(
    > Accessibility.IAccessible paccContainer,
    > int iChildStart,
    > int cChildren,
    > [Out] object[] rgvarChildren,
    > out int pcObtained);
    >
    > int _ChildCount = IACurrent.accChildCount;
    > object[] _Children = new object[_ChildCount];
    > int _out;
    >
    > AccessibleChildren(IACurrent,0,_ChildCount-1,_Children,out _out);
    >
    > It doesn't work on VB 2005. An empty Children is returned.
    > However, it does work on VB6 by declaring Children as a Variant. Any
    > ideas?


    I will just assume that you posted this to the wrong group.

    --
    Erik Wikström
    =?ISO-8859-1?Q?Erik_Wikstr=F6m?=, Sep 4, 2007
    #2
    1. Advertising

  3. codercode

    BobR Guest

    codercode <> wrote in message...
    >
    > int _ChildCount = IACurrent.accChildCount;


    An underscore followed by an uppercase character is reserved to the
    implementation.

    The code you showed is not compilable.

    FAQ http://www.parashift.com/c -faq-lite

    --
    Bob R
    POVrookie
    BobR, Sep 4, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lenny
    Replies:
    1
    Views:
    477
    Steve C. Orr [MVP, MCSD]
    Jan 14, 2004
  2. Replies:
    10
    Views:
    1,219
    Big K
    Feb 2, 2005
  3. Dr Mephesto

    App idea, Any idea on implementation?

    Dr Mephesto, Feb 4, 2008, in forum: Python
    Replies:
    3
    Views:
    701
    Dennis Lee Bieber
    Feb 5, 2008
  4. Replies:
    0
    Views:
    620
  5. Lovely Angel
    Replies:
    2
    Views:
    306
    Evertjan.
    Sep 17, 2004
Loading...

Share This Page