Open a file explorer in a dialog based MFC app
-
Hi guys, I do need your suggestions. In document based MFC application, there is a menu item “ID_FILE_OPEN”. When you press it, it will run cWinApp::OnFileOpen. Now, I have a dialog based MFC application. I want to add a button to achieve above function. When I press the button, it can open a file explorer or file manager. By the way, this MFC application doesn’t have StdAfx files. What I should do?
-
Hi guys, I do need your suggestions. In document based MFC application, there is a menu item “ID_FILE_OPEN”. When you press it, it will run cWinApp::OnFileOpen. Now, I have a dialog based MFC application. I want to add a button to achieve above function. When I press the button, it can open a file explorer or file manager. By the way, this MFC application doesn’t have StdAfx files. What I should do?
Add an event handler for the button click event. Then use the CFileDialog class to prompt the user to select a file to open. From here it depends on how you have the data saved (serialized). You will have to supply your own file reading function. You can use the CFile class to open and read the file data or the ansi fopen, fread functions. Gary Kirkham A working Program is one that has only unobserved bugs I thought I wanted a career, turns out I just wanted paychecks
-
Hi guys, I do need your suggestions. In document based MFC application, there is a menu item “ID_FILE_OPEN”. When you press it, it will run cWinApp::OnFileOpen. Now, I have a dialog based MFC application. I want to add a button to achieve above function. When I press the button, it can open a file explorer or file manager. By the way, this MFC application doesn’t have StdAfx files. What I should do?