【VC开源代码栏目提醒】:网学会员为广大网友收集整理了,ConnectPrompt.cpp,希望对大家有所帮助!
// ConnectPrompt.cpp : implementation file
//
#include "stdafx.h"
#include "NetMsgClient.h"
#include "ConnectPrompt.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CConnectPrompt dialog
CConnectPrompt::CConnectPrompt(CWnd* pParent /*=NULL*/)
: CDialog(CConnectPrompt::IDD, pParent)
{
//{{AFX_DATA_INIT(CConnectPrompt)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CConnectPrompt::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CConnectPrompt)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CConnectPrompt, CDialog)
//{{AFX_MSG_MAP(CConnectPrompt)
ON_WM_TIMER()
ON_WM_SHOWWINDOW()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CConnectPrompt message handlers
void CConnectPrompt::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
static char str[40];
if(nCount ==0)
{
memset(str,0,sizeof(str));
strcpy(str,"NetMsg正在连接服务器");
}
else
{
strcat(str,".");
}
nCount++;
if(nCount ==10)
nCount=0;
GetDlgItem(IDC_SHOWCONNECT)->SetWindowText(str);
CDialog::OnTimer(nIDEvent);
}
BOOL CConnectPrompt::OnInitDialog()
{
CDialog::OnInitDialog();
GetDlgItem(IDC_SHOWCONNECT)->SetWindowText("NetMsg正在连接服务器");
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CConnectPrompt::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
if(bShow)
{
m_nTimer = SetTimer(2, 500, NULL);
}
else
{
KillTimer(m_nTimer);
}
nCount = 0;
}
上一篇:
ConnectionPoint.cpp
下一篇:
加强企业管理力度 提升产品绿色竞争力