Results 1 to 2 of 2

Thread: Does This Exsist In C++?

  1. #1

    Thread Starter
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    I want to know if it is possible to make control arrays in VC++ like in VB.
    Ex.textbox(1),textbox(2)
    And if it is possible - HOW?
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Not as such, since C++ doesn't have any mechanisms for doing it (it is non-visual by default). Although, you can do something like this:
    Code:
    long plTextBoxes[] = {IDC_TEXT1, IDC_TEXT2};
    
    SendMessage(GetDlgItem(hWnd_Main, plTextBoxes[1]), ...);
    Although you could always use a vector or list if you needed to dynamically allocate them.
    If you're using MFC then there is a (tricky) way to do it, but it needs to be tailored exactly to your project, since there is no generic method.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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