Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to call File Open dialog box function from File Menu (Open menu)?

how to call File Open dialog box function from File Menu (Open menu)?

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++tutorialquestionlearning
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mathivanaan
    wrote on last edited by
    #1

    Hi i am beginner of win32 Vc++. I create Menu item and call File open dialog box. I have a File Menu. it contains Open, save and exit menu items.I have file open dialog box function. Open menu item id is: ID_FILE_OPEN. my code like

    case WM\_COMMAND:
    		switch(wParam)
    		{
    			case IDOK:
    			    EndDialog(hWndDlg, 0);
    				return TRUE;
    
    			case IDCANCEL:
    				EndDialog(hWndDlg, 0);
    				return TRUE;
    			case ID\_FILE\_OPEN:
    				OnFileOpen(hWnd, ID\_FILE\_NEW, 0, 0);
    				break;
    
    		}
    

    But error is come like ID_FILE_OPEN' : undeclared identifier how to fix this? Regards, M.Mathivanan

    A 1 Reply Last reply
    0
    • M mathivanaan

      Hi i am beginner of win32 Vc++. I create Menu item and call File open dialog box. I have a File Menu. it contains Open, save and exit menu items.I have file open dialog box function. Open menu item id is: ID_FILE_OPEN. my code like

      case WM\_COMMAND:
      		switch(wParam)
      		{
      			case IDOK:
      			    EndDialog(hWndDlg, 0);
      				return TRUE;
      
      			case IDCANCEL:
      				EndDialog(hWndDlg, 0);
      				return TRUE;
      			case ID\_FILE\_OPEN:
      				OnFileOpen(hWnd, ID\_FILE\_NEW, 0, 0);
      				break;
      
      		}
      

      But error is come like ID_FILE_OPEN' : undeclared identifier how to fix this? Regards, M.Mathivanan

      A Offline
      A Offline
      Andrew Brock
      wrote on last edited by
      #2

      In your menu in the Resources window you will have specified a value for the menu item File>Open. You can find this value in the properties window (View->Other Windows->Properties Window) and click on the Open item in the file menu in the resource editor. The value will also be #define'd in the Resource.h file, so be sure to #include "Resource.h"

      M 1 Reply Last reply
      0
      • A Andrew Brock

        In your menu in the Resources window you will have specified a value for the menu item File>Open. You can find this value in the properties window (View->Other Windows->Properties Window) and click on the Open item in the file menu in the resource editor. The value will also be #define'd in the Resource.h file, so be sure to #include "Resource.h"

        M Offline
        M Offline
        mathivanaan
        wrote on last edited by
        #3

        Thanks. i understand. now its working.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups