passing arguments to dialog boxes?

This is a discussion on passing arguments to dialog boxes? within the Windows Programming forums, part of the Platform Specific Boards category; How can I pass a variable (like a string) to a dialog box? Lets say I create it like this: ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    3

    passing arguments to dialog boxes?

    How can I pass a variable (like a string) to a dialog box? Lets say I create it like this:


    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)
    {
    g_Hinst=hInstance;

    DialogBox(hInstance, MAKEINTRESOURCE(dlgMain), NULL, (DLGPROC)dlgMainProc );

    return 0;
    }

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    3

    oops, I didn't finish

    Sorry, I posted it without finishing. Anyway, If I have this:

    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)
    {
    char name[25];

    DialogBox(hInstance, MAKEINTRESOURCE(dlgMain), NULL, (DLGPROC)dlgMainProc );

    return 0;
    }


    How can I pass the name array to the dialog? I dont want to make name[] global

  3. #3
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    use DialogBoxParam() instead of DialogBox()
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  4. #4
    Registered User
    Join Date
    Nov 2002
    Posts
    3

    Smile

    Thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Common Dialog boxes GetOpenFileName()
    By A10 in forum Windows Programming
    Replies: 3
    Last Post: 09-02-2008, 09:56 PM
  2. Dialog Boxes
    By Thantos in forum Windows Programming
    Replies: 7
    Last Post: 08-26-2003, 01:49 PM
  3. Dialog Boxes and Sliders
    By AtomRiot in forum Windows Programming
    Replies: 4
    Last Post: 01-29-2003, 08:36 AM
  4. Dialog Boxes
    By cerion in forum Windows Programming
    Replies: 4
    Last Post: 06-10-2002, 07:54 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 10:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21