Article View: cn.bbs.comp.program
Article #1025VC50����
From: �ϵ�
Date: Sun, 26 Apr 1998 00:00
Date: Sun, 26 Apr 1998 00:00
44 lines
2217 bytes
2217 bytes
l �������Dialog��Command Update����?
����Cdialog��WM_INITMENUPOPUP, ��ʹ��
void CFrameWnd::OnInitMenuPopup (CMenu* pMenu, UINT, BOOL bSysMenu)
�е�source code,����Command Update����
l ���ʵ��Dialog��Menu�����ʹ���ļ�����?
���ʹ���ļ���������CWinApp��Command Update���ƺ�����������Ϣ����ģ�
ON_UPDATE_COMMAND_UI(ID_FILE_MRU_FILE1, OnUpdateRecentFileMenu)
ON_COMMAND_EX_RANGE(ID_FILE_MRU_FILE1,ID_FILE_MRU_FILE16, OnOpenRecentFile)
void CWinApp::OnUpdateRecentFileMenu(CCmdUI* pCmdUI)
{
ASSERT_VALID(this);
if (m_pRecentFileList == NULL) // no MRU files
pCmdUI->Enable(FALSE);
else
m_pRecentFileList->UpdateMenu(pCmdUI);
}
/////////////////////////////////////////////////////////////////////////////
// MRU file list default implementation
BOOL CWinApp::OnOpenRecentFile(UINT nID)
{
ASSERT_VALID(this);
ASSERT(m_pRecentFileList != NULL);
ASSERT(nID >= ID_FILE_MRU_FILE1);
ASSERT(nID < ID_FILE_MRU_FILE1 + (UINT)m_pRecentFileList->GetSize());
int nIndex = nID - ID_FILE_MRU_FILE1;
ASSERT((*m_pRecentFileList)[nIndex].GetLength() != 0);
TRACE2("MRU: open file (%d) '%s'.\n", (nIndex) + 1,
(LPCTSTR)(*m_pRecentFileList)[nIndex]);
if (OpenDocumentFile((*m_pRecentFileList)[nIndex]) == NULL)
m_pRecentFileList->Remove(nIndex);
return TRUE;
}
��ΪDialogû���ĵ�����������Ҫ��дOnOpenRecentFile.
--
[m[1;32m�� ��Դ:���ϴ�С�ٺ���Ϣ����վ bbs.nju.edu.cn��[FROM: a507yjh.nju.edu][m
Technical Details
Message-ID:
<3OG0R6$tv2@bbs.nju.edu.cn>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: fc86e,c224ae4fab56e118,start X-Google-Attributes: gidfc86e,public From: mendy.bbs@bbs.nju.edu.cn (�ϵ�) Subject: VC50С���� Date: 1998/04/26 Message-ID: <3OG0R6$tv2@bbs.nju.edu.cn> X-Deja-AN: 348008677 X-Filename: Programming/M.893584662.A Organization: nju_bbs Newsgroups: cn.bbs.comp.program