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. Good resource for MFC MDI application development??

Good resource for MFC MDI application development??

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestionlearning
5 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.
  • P Offline
    P Offline
    pavanbabut
    wrote on last edited by
    #1

    I am trying to develop a MDI application in MFC. I am going thru different books "MFC with Visual C++ 6"-Mike Blaszczak, "Visual C++ MFC Programming by Example"-John Swanke and MSDN (ofcourse). But they are all like bits and pieces for me and I am not able to get a good idea on building an application from scratch. Does anyone have a good resource on developing a MDI MFC application from scratch? My application is a BMP (mainly a 8bit gray scale BMP) viewer on which the user can select various points and highlight those points, the user should be also able to move/delete selected points and also perform some basic image processing techniques like brightness/contrast enhancement. I have the basic idea on how the interface should look like. thanks, -Pavan.

    M 1 Reply Last reply
    0
    • P pavanbabut

      I am trying to develop a MDI application in MFC. I am going thru different books "MFC with Visual C++ 6"-Mike Blaszczak, "Visual C++ MFC Programming by Example"-John Swanke and MSDN (ofcourse). But they are all like bits and pieces for me and I am not able to get a good idea on building an application from scratch. Does anyone have a good resource on developing a MDI MFC application from scratch? My application is a BMP (mainly a 8bit gray scale BMP) viewer on which the user can select various points and highlight those points, the user should be also able to move/delete selected points and also perform some basic image processing techniques like brightness/contrast enhancement. I have the basic idea on how the interface should look like. thanks, -Pavan.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      While MFC puts a nice object-oriented wrapper around much of the common Windows UI, IMO it's more important to have a good grasp on basic Windows UI development. Here's a link to a relevant part of the MSDN library. You may find the Windowing and User Input sections useful for starters. Windows User Interface[^] Hope this helps a little! Mark

      P 2 Replies Last reply
      0
      • M Mark Salsbery

        While MFC puts a nice object-oriented wrapper around much of the common Windows UI, IMO it's more important to have a good grasp on basic Windows UI development. Here's a link to a relevant part of the MSDN library. You may find the Windowing and User Input sections useful for starters. Windows User Interface[^] Hope this helps a little! Mark

        P Offline
        P Offline
        pavanbabut
        wrote on last edited by
        #3

        Thanks for your reply. I will go thru those articles and hope I will get some more knowledge on those topics. I am comfortable developing dialog based UI applications, but not MDI and this is the first one I am tyring to develop. -Pavan.

        1 Reply Last reply
        0
        • M Mark Salsbery

          While MFC puts a nice object-oriented wrapper around much of the common Windows UI, IMO it's more important to have a good grasp on basic Windows UI development. Here's a link to a relevant part of the MSDN library. You may find the Windowing and User Input sections useful for starters. Windows User Interface[^] Hope this helps a little! Mark

          P Offline
          P Offline
          pavanbabut
          wrote on last edited by
          #4

          I came up with lots of doubts after creating my first MDI application, but for the basic ones.. 1) First and foremost, how can I make a MDI applicaiton open with just the main frame (without child frame)? 2) How can I resize the child frame to the size of the image that is been opened by the user?? Say, if the image dimensions are less than the current main frame dimensions it will display in full scale, but if not, it should display the image covering the whole main frame with scrollbars to move down. 3) How can I open the image in child window so that it always resets itself to middle (aligned center)? i.e. even if the user clicks on the maximise button of child frame, the image should reset itself to the center of the main window. 4) How can I update the status bar panes while the user moves his mouse over the image?? I have a status bar in child window with a pane supposed to display the pixel location and intensity value. thanks, -Pavan.

          M 1 Reply Last reply
          0
          • P pavanbabut

            I came up with lots of doubts after creating my first MDI application, but for the basic ones.. 1) First and foremost, how can I make a MDI applicaiton open with just the main frame (without child frame)? 2) How can I resize the child frame to the size of the image that is been opened by the user?? Say, if the image dimensions are less than the current main frame dimensions it will display in full scale, but if not, it should display the image covering the whole main frame with scrollbars to move down. 3) How can I open the image in child window so that it always resets itself to middle (aligned center)? i.e. even if the user clicks on the maximise button of child frame, the image should reset itself to the center of the main window. 4) How can I update the status bar panes while the user moves his mouse over the image?? I have a status bar in child window with a pane supposed to display the pixel location and intensity value. thanks, -Pavan.

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #5
            1. An easy way to see is create an MFC multiple document project using the project wizard and look at what is in the application class' InitInstance() override. I just did one and it creates the frame like this:

              CMDIFrameWnd* pFrame = new CMainFrame;
              if (!pFrame)
              return FALSE;
              m_pMainWnd = pFrame;
              // create main MDI frame window
              if (!pFrame->LoadFrame(IDR_MAINFRAME))
              return FALSE;
              // try to load shared MDI menus and accelerator table
              //TODO: add additional member variables and load calls for
              // additional menu types your application may need
              HINSTANCE hInst = AfxGetResourceHandle();
              m_hMDIMenu = ::LoadMenu(hInst, MAKEINTRESOURCE(IDR_TestMDITYPE));
              m_hMDIAccel = ::LoadAccelerators(hInst, MAKEINTRESOURCE(IDR_TestMDITYPE));
              // The main window has been initialized, so show and update it
              pFrame->ShowWindow(m_nCmdShow);
              pFrame->UpdateWindow();

            2)3) Once you have the image size you can use MoveWindow to resize and reposition the child window within the parent frame. 4) CStatusBar::SetPaneText() can be used to set the text of the status bar in response to WM_MOUSEMOVE messages. For each message calculate the cursor position relative to the image, convert the results to a string, and display the string in the status bar.

            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