I recently did this with MFC, since you seem to be using MFC, maybe this will help:
in
BOOL MyApp::InitInstance()
{
SetRegistryKey("MyApp");
LoadStdProfileSettings();
}
// ..
void MyApp::addToRecentFileList(boost::filesystem::path const& path)
{
AddToRecentFileList(path.file_string().c_str());
}
boost::filesystem::path MyApp::getRecentFile(int index) const
{
return std::string((*m_pRecentFileList)[index]);
}
// ...
BOOL MyFrame::OnCommand(WPARAM wParam, LPARAM lParam)
{
BOOL answ = TRUE;
if(wParam >= ID_FILE_MRU_FILE1 && wParam <= ID_FILE_MRU_FILE16)
{
int nIndex = wParam - ID_FILE_MRU_FILE1;
boost::filesystem::path path = getApp()->getRecentFile(nIndex);
return answ;
}
}
You only need your application to be obtained from CWinApp (and I'm using a class derived from CFrmWnd to handle the menu, maybe you are doing the same?).
Tell me if this works for you. Not sure if I have everything.