Thread: Variable "transfer"

  1. #1
    Rad gcn_zelda's Avatar
    Join Date
    Mar 2003
    Posts
    942

    Variable "transfer"

    What would be the most efficient way to "transfer" a variable from one switch case to the next?
    Ex.

    Code:
    case ID_FILE_SAVE:
    {
       OPENFILENAME ofn;
       //ofn stuff
    }
    case ID_VIEW_PREVIEW:
    {
        ShellExecute(hwnd, open, ofn...)
    }
    I need to "retrieve" the data from the first ofn to the second.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Declare it outside the switch statement so that it will be in scope for all case blocks.

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How accurate is the following...
    By emeyer in forum C Programming
    Replies: 22
    Last Post: 12-07-2005, 12:07 PM
  2. static class variable vs. global variable
    By nadamson6 in forum C++ Programming
    Replies: 18
    Last Post: 09-30-2005, 03:31 PM
  3. Replies: 2
    Last Post: 04-12-2004, 01:37 AM
  4. write Variable and open Variable and get Information
    By cyberbjorn in forum C++ Programming
    Replies: 2
    Last Post: 04-09-2004, 01:30 AM
  5. Variable question I can't find answer to
    By joelmon in forum C++ Programming
    Replies: 3
    Last Post: 02-12-2002, 04:11 AM