CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 1999
    Posts
    57

    How can I pass a structure in VB?

    Hi,
    How can I pass a structure in VB?
    or Any equivalent solutions?
    Thanks in advance,
    Lijo


  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: How can I pass a structure in VB?

    Simple. Define it and pass! :-)

    A structure is defined with "Type"

    Pulic Type Rect
    Left as long
    Top as long
    Right as Long
    Bottom as Long
    end type



    is the standard definition for a "Rectangle" often used in Windows API.

    To pass it to a function define:

    public Function someFunc( byref lpRect as Rect)
    lprect.Left = ....
    end function




    A typical windows call would be like this:
    GetWindowRect(rect1)......

    Look up "Type" in Vb Help. That would be easier.


    RK

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

Featured