BOOL CDrawApp::InitInstance()
{
...
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization. SetRegistryKey(_T("VCGuide"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
...
}
void CDrawView::OnInitialUpdate()
{
CView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
m_nPenThickness = AfxGetApp()->GetProfileInt("Pen", "Thickness", 2);
...
}
void CDrawView::OnLine()
{
// TODO: Add your command handler code here
// 직선그리기 모드 변경
m_nDrawMode = LINE_MODE;
}
void CDrawView::OnUpdateLine(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
// 직선 그리기 모드이면 메뉴에 체크 표시
pCmdUI->SetCheck(m_nDrawMode == LINE_MODE? 1 : 0);
}
void CDrawView::OnEllipse()
{
// TODO: Add your command handler code here
// 원 그리기 모드 변경
m_nDrawMode = ELLIPSE_MODE;
}
... void CDrawView::OnSelectPenThickness(UINT nID)
{
// TODO: Add your command handler code here
m_nPenThickness = nID - ID_PEN_1PIXEL + 1;
AfxGetApp()->WriteProfileInt("Pen", "Thickness", m_nPenThickness);