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