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

    FlexGrid.AddItem

    Hi,
    Trying to port a VB program to VC++. I'm using a Flexgrid and the AddItem method takes two param's. In VB the second param was optional and I didn't use it. In VC++ that doesn't seem to be the case. It takes a 'tagVARIANT'type to a index.
    Could someone show me how to load this param and how to set it up? I'm really losted on this.

    Thanks
    Steve P.


  2. #2
    Join Date
    May 1999
    Location
    Republic of Korea
    Posts
    100

    Re: FlexGrid.AddItem

    Welcome to VC!!

    I did developed an application with VB before but I am porting
    to VC cuz VB didn't allow me and sometimes harder to customize its ctrls and many other stuff. But as U expect U have to do a lot more for Ur self where some functionalities were taken for granted in VB.
    Anyway, what U could need to do is U need to declare a variable type VARIANT and set its type. In Ur case, set type to LONG cuz second param is msflexgrid row value.

    Here is a little declaration:

    VARIANT row;
    row.vt=VT_I4
    row.lVal = someRowValue;
    m_flexgrid.AddItem(UrString, row);

    There U are!! But I am not saying my way is optimum.
    CHECK VARIANT STRUCTURE AND COLEVARIANT CLASS FOR FURTHER INFORMATION!!

    Hope for help and good luck to U.

    Walter


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