BOOL CProgressDlg::OnInitDialog()
{
..
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
// <
m_ctrlProgress.SetRange(0, 100);
m_ctrlProgress.SetStep(1);
// >
return TRUE; // return TRUE unless you set the focus to a control
}
class CPractice9_2Dlg : public CDialog
{
// {
int m_nTransmitRate;
// }
// Construction
public:
CPractice9_2Dlg(CWnd* pParent = NULL); // standard constructor
BEGIN_MESSAGE_MAP(CPractice9_2Dlg, CDialog)
//{{AFX_MSG_MAP(CPractice9_2Dlg)
...
ON_BN_CLICKED(IDC_BUTTON_TRANSMIT, OnButtonTransmit)
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
...
BOOL CPractice9_2Dlg::OnInitDialog()
{
...
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
// {
m_prgsTransmit.SetRange(0, 100);
m_prgsTransmit.SetPos(0);
// }
return TRUE; // return TRUE unless you set the focus to a control
}
...
void CPractice9_2Dlg::OnButtonTransmit()
{
// TODO: Add your control notification handler code here
//현재 데이터 전송률을 0 퍼센트로 설정한다.
m_nTransmitRate = 0;
// 타이머를 지정한다. 타이머 ID=1, 구간=30
SetTimer(1, 30, NULL);
}
void CPractice9_2Dlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
// {
if (m_nTransmitRate != 100)
{
m_nTransmitRate++;
m_prgsTransmit.SetPos(m_nTransmitRate);
...
}
else
{
KillTimer(1);