www.pudn.com > 编译原理课程设计与实现(毕业设计).rar > PL0Dlg.cpp
// PL0Dlg.cpp : implementation file
//
#include "stdafx.h"
#include "PL0.h"
#include "PL0Dlg.h"
#include "AboutDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPL0Dlg dialog
CPL0Dlg::CPL0Dlg(CWnd* pParent /*=NULL*/)
: CDialog(CPL0Dlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CPL0Dlg)
m_cStateBar = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CPL0Dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPL0Dlg)
DDX_Control(pDX, IDC_OUTCTRL, m_cOut);
DDX_Control(pDX, IDC_INCTRL, m_cIn);
DDX_Text(pDX, IDC_STATEBAR, m_cStateBar);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPL0Dlg, CDialog)
//{{AFX_MSG_MAP(CPL0Dlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_COMMAND(ID_MENUITEM_ABOUT, OnMenuitemAbout)
ON_COMMAND(ID_MENUITEM_NEW, OnMenuitemNew)
ON_COMMAND(ID_MENUITEM_OPEN, OnMenuitemOpen)
ON_COMMAND(ID_MENUITEM_SAVE, OnMenuitemSave)
ON_COMMAND(ID_MENUITEM_SAVEAS, OnMenuitemSaveas)
ON_COMMAND(ID_MENUITEM_EXIT, OnMenuitemExit)
ON_COMMAND(ID_MENUITEM_UNDO, OnMenuitemUndo)
ON_COMMAND(ID_MENUITEM_CUT, OnMenuitemCut)
ON_COMMAND(ID_MENUITEM_COPY, OnMenuitemCopy)
ON_COMMAND(ID_MENUITEM_PASTE, OnMenuitemPaste)
ON_COMMAND(ID_MENUITEM_DEL, OnMenuitemDel)
ON_COMMAND(ID_MENUITEM_ALL, OnMenuitemAll)
ON_COMMAND(ID_MENUITEM_CIFA, OnMenuitemCifa)
ON_COMMAND(ID_MENUITEM_YUFA, OnMenuitemYufa)
ON_COMMAND(ID_MENUITEM_YUYI, OnMenuitemYuyi)
ON_COMMAND(ID_MENUITEM_MANUAL, OnMenuitemManual)
ON_WM_CLOSE()
ON_EN_UPDATE(IDC_INCTRL, OnUpdateInctrl)
ON_BN_CLICKED(IDC_BUTTON_CIFA, OnButtonCifa)
ON_BN_CLICKED(IDC_BUTTON_YUFA, OnButtonYufa)
ON_BN_CLICKED(IDC_BUTTON_YUYI, OnButtonYuyi)
ON_UPDATE_COMMAND_UI(ID_MENUITEM_ALL, OnUpdateMenuitemAll)
ON_UPDATE_COMMAND_UI(ID_MENUITEM_DEL, OnUpdateMenuitemDel)
ON_UPDATE_COMMAND_UI(ID_MENUITEM_PASTE, OnUpdateMenuitemPaste)
ON_UPDATE_COMMAND_UI(ID_MENUITEM_COPY, OnUpdateMenuitemCopy)
ON_UPDATE_COMMAND_UI(ID_MENUITEM_CUT, OnUpdateMenuitemCut)
ON_UPDATE_COMMAND_UI(ID_MENUITEM_UNDO, OnUpdateMenuitemUndo)
ON_COMMAND(ID_MENUITEM_SYS, OnMenuitemSys)
ON_UPDATE_COMMAND_UI(ID_MENUITEM_SYS, OnUpdateMenuitemSys)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPL0Dlg message handlers
BOOL CPL0Dlg::OnInitDialog()
{
CDialog::OnInitDialog();
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
pSysMenu->DeleteMenu(4,MF_BYPOSITION);
pSysMenu->DeleteMenu(2,MF_BYPOSITION);
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
m_cIn.SetModify(FALSE);
OnMenuitemNew();
m_bSysEnable=TRUE;
return TRUE; // return TRUE unless you set the focus to a control
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CPL0Dlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CPL0Dlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CPL0Dlg::OnMenuitemAbout()
{
// TODO: Add your command handler code here
CAboutDlg dlg;
dlg.DoModal();
}
void CPL0Dlg::OnMenuitemNew()
{
// TODO: Add your command handler code here
if (m_cIn.GetModify())
{
switch (AfxMessageBox("要保存修改吗?!",MB_YESNOCANCEL|MB_ICONQUESTION))
{
case IDYES:
OnMenuitemSave();
break;
case IDCANCEL:
return;
default:
;
}
}
m_strCurFile="";
m_cIn.SetSel(0,-1);
m_cIn.Clear();
m_cIn.EmptyUndoBuffer();
SetWindowText("PL/0 编译器 当前源文件:无标题");
m_cIn.SetModify(FALSE);
}
void CPL0Dlg::OnMenuitemOpen()
{
// TODO: Add your command handler code here
if (m_cIn.GetModify())
{
switch (AfxMessageBox("要保存修改吗?!",MB_YESNOCANCEL|MB_ICONQUESTION))
{
case IDYES:
OnMenuitemSave();
break;
case IDCANCEL:
return;
default:
;
}
}
CFileDialog fdlg(TRUE,"pl0",NULL,OFN_FILEMUSTEXIST,
"PL/0 源程序文件(*.pl0)|*.pl0|所有文件(*.*)|*.*||",this);
fdlg.m_ofn.lpstrTitle="打开PL/0源程序文件";
if (fdlg.DoModal()==IDOK)
{
m_strCurFile=fdlg.GetPathName();
CFile f;
f.Open(m_strCurFile,CFile::modeRead);
char buf[30001];
int sz=f.Read(buf,30000);
buf[sz]=0;
m_cIn.SetWindowText(buf);
m_cIn.SetSel(0,0);
f.Close();
char a[255];
::strcpy(a,"PL/0 编译器 当前源文件:");
::strcat(a,m_strCurFile.GetBuffer(0));
SetWindowText(a);
m_cIn.SetModify(FALSE);
}
}
void CPL0Dlg::OnMenuitemSave()
{
// TODO: Add your command handler code here
if (m_strCurFile!="")
{
char buf[30001];
int sz=m_cIn.GetWindowText(buf,30000);
CFile f;
f.Open(m_strCurFile,CFile::modeWrite|CFile::modeCreate);
f.Write(buf,sz);
f.Close();
char a[255];
::strcpy(a,"PL/0 编译器 当前源文件:");
::strcat(a,m_strCurFile.GetBuffer(0));
SetWindowText(a);
m_cIn.SetModify(FALSE);
}
else
{
OnMenuitemSaveas();
}
}
void CPL0Dlg::OnMenuitemSaveas()
{
// TODO: Add your command handler code here
CFileDialog fdlg(FALSE,"pl0",NULL,OFN_OVERWRITEPROMPT,
"PL/0 源程序文件(*.pl0)|*.pl0|所有文件(*.*)|*.*||",this);
fdlg.m_ofn.lpstrTitle="保存PL/0源程序文件";
if (fdlg.DoModal()==IDOK)
{
m_strCurFile=fdlg.GetPathName();
char buf[30001];
int sz=m_cIn.GetWindowText(buf,30000);
CFile f;
f.Open(m_strCurFile,CFile::modeWrite|CFile::modeCreate);
f.Write(buf,sz);
f.Close();
m_cIn.SetModify(FALSE);
char a[255];
::strcpy(a,"PL/0 编译器 当前源文件:");
::strcat(a,m_strCurFile.GetBuffer(0));
SetWindowText(a);
}
}
void CPL0Dlg::OnMenuitemExit()
{
// TODO: Add your command handler code here
OnClose();
}
void CPL0Dlg::OnMenuitemUndo()
{
// TODO: Add your command handler code here
if (m_cIn.GetFocus()==&m_cIn) m_cIn.Undo();
}
void CPL0Dlg::OnMenuitemCut()
{
// TODO: Add your command handler code here
if (m_cIn.GetFocus()==&m_cIn) m_cIn.Cut();
}
void CPL0Dlg::OnMenuitemCopy()
{
// TODO: Add your command handler code here
if (m_cIn.GetFocus()==&m_cIn) m_cIn.Copy();
if (m_cIn.GetFocus()==&m_cOut) m_cOut.Copy();
}
void CPL0Dlg::OnMenuitemPaste()
{
// TODO: Add your command handler code here
if (m_cIn.GetFocus()==&m_cIn) m_cIn.Paste();
}
void CPL0Dlg::OnMenuitemDel()
{
// TODO: Add your command handler code here
if (m_cIn.GetFocus()==&m_cIn) m_cIn.Clear();
}
void CPL0Dlg::OnMenuitemAll()
{
// TODO: Add your command handler code here
if (m_cIn.GetFocus()==&m_cIn) m_cIn.SetSel(0,-1);
if (m_cIn.GetFocus()==&m_cOut) m_cOut.SetSel(0,-1);
}
void CPL0Dlg::OnMenuitemCifa()
{
// TODO: Add your command handler code here
char buf[30003];
int sz=m_cIn.GetWindowText(buf,30000);
buf[sz]=0;
::strcpy(m_Compiler.GetTable()->SourseBuffer,buf);
m_Compiler.CiFaFengXi();
CifaResult * * p=m_Compiler.GetTable()->LexicalDuad;
int s=0;
int a=p[s]->type;
while ((p[s]->type)>=0)
s++;
char (*ep)[100];
ep=m_Compiler.GetTable()->ErrorMessageTable;
//result to : p,s,ep
m_cOut.SetWindowText("");
CString str;
int ErrorCount=0;
str.Format("输出格式:二元式序列(类型,值)单词\r\n\r\n");
m_cOut.AppendText(str.GetBuffer(0));
for (int i=0;itype>0)
{
str.Format("(%d,%d)\t%s\r\n",p[i]->type,p[i]->value,p[i]->text);
m_cOut.AppendText(str.GetBuffer(0));
}
else
{
ErrorCount++;
if (p[i]->value==2 && (p[i]->text[0]>126 || p[i]->text[0]<32))
{
str.Format("错误号:%d %s 【 无法显示该字符! 】\r\n",
p[i]->value,ep[p[i]->value]);
m_cOut.AppendText(str.GetBuffer(0));
}
else
{
str.Format("错误号:%d %s 【 %s 】\r\n",
p[i]->value,ep[p[i]->value],p[i]->text);
m_cOut.AppendText(str.GetBuffer(0));
}
}
}
str.Format("\r\n 发现 %d 个错误!\r\n",ErrorCount);
m_cOut.AppendText(str.GetBuffer(0));
}
void CPL0Dlg::OnMenuitemYufa()
{
// TODO: Add your command handler code here
char buf[30003];
int sz=m_cIn.GetWindowText(buf,30000);
buf[sz]=0;
::strcpy(m_Compiler.GetTable()->SourseBuffer,buf);
m_Compiler.CiFaFengXi();
CifaResult * * cp=m_Compiler.GetTable()->LexicalDuad;
int s=0;
while ((cp[s]->type)>=0)
s++;
char (*ep)[100];
ep=m_Compiler.GetTable()->ErrorMessageTable;
for (int i=0;itype==0)
if (AfxMessageBox("源程序有词法错误,仍要继续吗?"
,MB_YESNO|MB_ICONQUESTION)==IDNO)
return;
else break;
m_Compiler.YuFaFengXi();
//result to : cp,s,ep
m_cOut.SetWindowText("");
CString str;
str.Format("语法分析结果:\r\n\r\n");
m_cOut.AppendText(str.GetBuffer(0));
if (m_Compiler.GetTable()->ErrorNumber==0)
{
str.Format("源程序在语法上正确!\r\n");
m_cOut.AppendText(str.GetBuffer(0));
}
else
{
str.Format("源程序有语法错误!!\r\n");
m_cOut.AppendText(str.GetBuffer(0));
m_cIn.SetSel(cp[m_Compiler.GetTable()->ErrorAddress]->address,
cp[m_Compiler.GetTable()->ErrorAddress]->address
+::strlen(cp[m_Compiler.GetTable()->ErrorAddress]->text));
str.Format("\r\n错误号:%d %s\r\n",
m_Compiler.GetTable()->ErrorNumber,
ep[m_Compiler.GetTable()->ErrorNumber]);
m_cOut.AppendText(str.GetBuffer(0));
}
}
void CPL0Dlg::OnMenuitemYuyi()
{
// TODO: Add your command handler code here
m_cIn.GetWindowText(m_Compiler.GetTable()->SourseBuffer,30000);
m_Compiler.CiFaFengXi();
m_Compiler.YuYiFengXi();
m_cOut.SetWindowText("");
int i=0;CString str;
while (m_Compiler.GetTable()->LexicalDuad[i]->type>=0)
{
if (m_Compiler.GetTable()->LexicalDuad[i]->type==0)
{
str.Format("源程序有词法错误:\r\n\r\n");
m_cOut.AppendText(str.GetBuffer(0));
str.Format("错误号:%d %s\r\n",
m_Compiler.GetTable()->LexicalDuad[i]->value,
m_Compiler.GetTable()->ErrorMessageTable[m_Compiler.GetTable()->LexicalDuad[i]->value]);
m_cOut.AppendText(str.GetBuffer(0));
int se=m_Compiler.GetTable()->LexicalDuad[i]->address;
int sl=::strlen(m_Compiler.GetTable()->LexicalDuad[i]->text);
m_cIn.SetSel(se,se+sl);
return;
}
i++;
}
str.Format("语义分析结果:\r\n\r\n");
m_cOut.AppendText(str.GetBuffer(0));
if (m_Compiler.GetTable()->ErrorNumber!=0)
{
str.Format("错误号:%d %s\r\n\r\n",
m_Compiler.GetTable()->ErrorNumber,
m_Compiler.GetTable()->ErrorMessageTable[m_Compiler.GetTable()->ErrorNumber]);
m_cOut.AppendText(str.GetBuffer(0));
int se=m_Compiler.GetTable()->LexicalDuad[m_Compiler.GetTable()->ErrorAddress]->address;
int sl=::strlen(m_Compiler.GetTable()->LexicalDuad[m_Compiler.GetTable()->ErrorAddress]->text);
m_cIn.SetSel(se,se+sl);
if (AfxMessageBox("源程序有错误,要列出四元式吗?"
,MB_YESNO|MB_ICONQUESTION)==IDNO)
return;
}
if (!m_bSysEnable)
{
str.Format("输出格式:行号,四元式。\r\n\r\n");
m_cOut.AppendText(str.GetBuffer(0));
i=1;
while (m_Compiler.GetTable()->SemanticQuad[i].op!=0)
{
str.Format("%d\t(%s\t,(%d,%d),(%d,%d),(%d,%d))\r\n",i,
m_Compiler.GetTable()->QuadOpcodeTable[m_Compiler.GetTable()->SemanticQuad[i].op],
m_Compiler.GetTable()->SemanticQuad[i].arg1.fl,
m_Compiler.GetTable()->SemanticQuad[i].arg1.flvalue,
m_Compiler.GetTable()->SemanticQuad[i].arg2.fl,
m_Compiler.GetTable()->SemanticQuad[i].arg2.flvalue,
m_Compiler.GetTable()->SemanticQuad[i].result.fl,
m_Compiler.GetTable()->SemanticQuad[i].result.flvalue);
m_cOut.AppendText(str.GetBuffer(0));
i++;
}
}
else
{
str.Format("输出格式:行号,四元式(操作,操作数,操作数,结果)。\r\n\r\n");
m_cOut.AppendText(str.GetBuffer(0));
i=1;
while (m_Compiler.GetTable()->SemanticQuad[i].op!=0)
{
str.Format("%d\t(%s\t,",i,
m_Compiler.GetTable()->QuadOpcodeTable[m_Compiler.GetTable()->SemanticQuad[i].op]);
m_cOut.AppendText(str.GetBuffer(0));
switch (m_Compiler.GetTable()->SemanticQuad[i].arg1.fl)
{
case 0:
str.Format("__,");break;
case 1:
str.Format("%d,",m_Compiler.GetTable()->SemanticQuad[i].arg1.flvalue);break;
case 2:
str.Format("I%d,",m_Compiler.GetTable()->SemanticQuad[i].arg1.flvalue);break;
case 3:
str.Format("T%d,",m_Compiler.GetTable()->SemanticQuad[i].arg1.flvalue);break;
case 4:
str.Format("V%d,",m_Compiler.GetTable()->SemanticQuad[i].arg1.flvalue);break;
case 5:
str.Format("VV%d,",m_Compiler.GetTable()->SemanticQuad[i].arg1.flvalue);break;
default:
str.Format("P%d_%d,",
m_Compiler.GetTable()->SemanticQuad[i].arg1.fl-6,
m_Compiler.GetTable()->SemanticQuad[i].arg1.flvalue);
}
m_cOut.AppendText(str.GetBuffer(0));
switch (m_Compiler.GetTable()->SemanticQuad[i].arg2.fl)
{
case 0:
str.Format("__,");break;
case 1:
str.Format("%d,",m_Compiler.GetTable()->SemanticQuad[i].arg2.flvalue);break;
case 2:
str.Format("I%d,",m_Compiler.GetTable()->SemanticQuad[i].arg2.flvalue);break;
case 3:
str.Format("T%d,",m_Compiler.GetTable()->SemanticQuad[i].arg2.flvalue);break;
case 4:
str.Format("V%d,",m_Compiler.GetTable()->SemanticQuad[i].arg2.flvalue);break;
case 5:
str.Format("VV%d,",m_Compiler.GetTable()->SemanticQuad[i].arg2.flvalue);break;
default:
str.Format("P%d_%d,",
m_Compiler.GetTable()->SemanticQuad[i].arg2.fl-6,
m_Compiler.GetTable()->SemanticQuad[i].arg2.flvalue);
}
m_cOut.AppendText(str.GetBuffer(0));
switch (m_Compiler.GetTable()->SemanticQuad[i].result.fl)
{
case 0:
str.Format("__)\r\n");break;
case 1:
str.Format("%d)\r\n",m_Compiler.GetTable()->SemanticQuad[i].result.flvalue);break;
case 2:
str.Format("I%d)\r\n",m_Compiler.GetTable()->SemanticQuad[i].result.flvalue);break;
case 3:
str.Format("T%d)\r\n",m_Compiler.GetTable()->SemanticQuad[i].result.flvalue);break;
case 4:
str.Format("V%d)\r\n",m_Compiler.GetTable()->SemanticQuad[i].result.flvalue);break;
case 5:
str.Format("VV%d)\r\n",m_Compiler.GetTable()->SemanticQuad[i].result.flvalue);break;
default:
str.Format("P%d_%d)\r\n",
m_Compiler.GetTable()->SemanticQuad[i].result.fl-6,
m_Compiler.GetTable()->SemanticQuad[i].result.flvalue);
}
m_cOut.AppendText(str.GetBuffer(0));
i++;
}
str.Format("\r\n四元式说明:\r\n\r\n");
m_cOut.AppendText(str.GetBuffer(0));
str.Format("空:__\r\n常数:###\r\n指令入口:I###\r\n临时变量:T###\r\n直接访问变量:V###\r\n间接访问变量:VV###\r\n第i外层变量:Pi_###\r\n");
m_cOut.AppendText(str.GetBuffer(0));
str.Format("(###为数字)\r\n");
m_cOut.AppendText(str.GetBuffer(0));
}
}
void CPL0Dlg::OnMenuitemManual()
{
// TODO: Add your command handler code here
AfxMessageBox("没发现帮助文件,您使用的可能是盗版!");
}
void CPL0Dlg::OnCancel()
{
// TODO: Add extra cleanup here
// CDialog::OnCancel();
}
void CPL0Dlg::OnOK()
{
// TODO: Add extra validation here
// CDialog::OnOK();
}
void CPL0Dlg::OnClose()
{
// TODO: Add your message handler code here and/or call default
if (m_cIn.GetModify())
{
switch (AfxMessageBox("要保存修改吗?!",MB_YESNOCANCEL|MB_ICONQUESTION))
{
case IDYES:
OnMenuitemSave();
break;
case IDCANCEL:
return;
default:
;
}
}
if (IDNO==AfxMessageBox("真的要退出吗?",MB_YESNO|MB_ICONQUESTION))
{
return;
}
EndDialog(IDCANCEL);
CDialog::OnClose();
}
void CPL0Dlg::OnUpdateInctrl()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_UPDATE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
char a[255];
int sz=GetWindowText(a,254);
if (a[sz-1]!='*')
{
::strcat(a," *");
SetWindowText(a);
}
}
void CPL0Dlg::OnButtonCifa()
{
// TODO: Add your control notification handler code here
OnMenuitemCifa();
}
void CPL0Dlg::OnButtonYufa()
{
// TODO: Add your control notification handler code here
OnMenuitemYufa();
}
void CPL0Dlg::OnButtonYuyi()
{
// TODO: Add your control notification handler code here
OnMenuitemYuyi();
}
void CPL0Dlg::OnUpdateMenuitemAll(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if ((m_cIn.GetFocus()==&m_cIn) || (m_cIn.GetFocus()==&m_cOut)) pCmdUI->Enable(TRUE);
else pCmdUI->Enable(FALSE);
}
void CPL0Dlg::OnUpdateMenuitemDel(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_cIn.GetFocus()==&m_cIn) pCmdUI->Enable(TRUE);
else pCmdUI->Enable(FALSE);
}
void CPL0Dlg::OnUpdateMenuitemPaste(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_cIn.GetFocus()==&m_cIn) pCmdUI->Enable(TRUE);
else pCmdUI->Enable(FALSE);
}
void CPL0Dlg::OnUpdateMenuitemCopy(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if ((m_cIn.GetFocus()==&m_cIn) || (m_cIn.GetFocus()==&m_cOut)) pCmdUI->Enable(TRUE);
else pCmdUI->Enable(FALSE);
}
void CPL0Dlg::OnUpdateMenuitemCut(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_cIn.GetFocus()==&m_cIn) pCmdUI->Enable(TRUE);
else pCmdUI->Enable(FALSE);
}
void CPL0Dlg::OnUpdateMenuitemUndo(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_cIn.GetFocus()==&m_cIn) pCmdUI->Enable(TRUE);
else pCmdUI->Enable(FALSE);
}
void CPL0Dlg::OnMenuitemSys()
{
// TODO: Add your command handler code here
m_bSysEnable=!m_bSysEnable;
}
void CPL0Dlg::OnUpdateMenuitemSys(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
pCmdUI->SetCheck(m_bSysEnable);
}