Results 1 to 2 of 2

Thread: InterOP call with object Array from .NET

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    5

    InterOP call with object Array from .NET

    hi all,
    i have a object array declared in .net and i created a type library and referenced in VB6 prj. i cant able to access the object array returned from .NET.

    my obj in .NET
    class A
    public age
    public personname
    public addresses[] address
    end class

    class personName
    public firstname
    public secondname
    end class

    class address
    public street
    public area
    end class

    the above class declaration done in csharp i just given sample code the addressess is object array of address which holds office address and home address

    Now this object is return from .net to vb here the code below

    vb
    dim obj as A
    set a=methodreturnResponse()

    dim ageres as string = a.Age getting age
    dim i as integer
    for i=lbound(a.addresses) to ubound(a.addresses)
    dim objadd as address
    set objadd = a.addresses(i) returns empty always why?

    next i

    in above code the object from .net returns 2 address in address object. i am getting ubound as 2 and when i try to access the addressess obj which always return empy or nothing why

    please clarify
    regards
    Pandi G S

  2. #2

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    5

    Re: InterOP call with object Array from .NET

    Hi all
    I got the solution , need to access the array object through variant
    For Each variantObj In resp.addrArr
    Debug.Print variantObj.Address1
    next

    will read the array value as above said

    thanks
    regards
    Pandi GS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width