单击按钮后如何打开最近的项目 [英] How can I open recent project after I clicked the button
问题描述
嗨
我的星座按钮,代表最后打开的项目。
我想在我按下Button按钮后打开它。
我也知道最近开放项目的路径。
我尝试过:
我点击了按钮上的AddEventHandler,它创建了空方法。该方法也在Resources.cpp中,我认为它应该在我的startpage.cpp中。无论如何我不知道打开最近项目文件的方法
Hi
I have on my starpage buttons, which represents last open projects.
I would like to open it after I clik my Button Control.
I know also the paths of recent open projects.
What I have tried:
I clicked AddEventHandler on the button, which created the empty method. The method is also in Resources.cpp , I thought that it should be in my startpage.cpp. Anyway I do not know the method to open the recent project files
推荐答案
参见 ^ ]和如何从MRU列表mfc获取项目名称? [ ^ ]。
只需调用CWinApp :: OpenDocumentFile()
将路径传递给该文件。如果您没有指向CWinApp
派生类的指针,请使用
Just callCWinApp::OpenDocumentFile()
passing the path to the file. If you dont have a pointer to yourCWinApp
derived class use
AfxGetApp()->OpenDocumentFile(m_lpszPath, FALSE);
或传递 TRUE
将文件放在MRU列表的顶部。
[/ EDIT]
Or pass TRUE
to put the file on top of the MRU list.
[/EDIT]
这篇关于单击按钮后如何打开最近的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!