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

    Passing structure from VC++ to VB



    I would like to know if there is a way to pass a structure from VC++ to VB.

    I created an ActiveX control which can passed parameter by value but I want to

    pass an address of a structure back


    Thank



  2. #2
    Join Date
    Dec 1998
    Posts
    5

    Re: Passing structure from VC++ to VB



    Hi


    You can pass a pointer to the struct (like in the GetWindowRect -> LPRECT)

    In VB declare this as ....(...., MyVar As MyStruct) ( just as in the GetWindowRect)

    VB's default for passing values is ByRef, which is a kind of a pointer.

    So it should work. Although you might have some troubles if the struct contains char pointers. VB might have some trouble with that, because the sizeof of the struct is unknown at that point.


    Hope it helps


    Crazy D

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