⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showmsg.cpp

📁 信息提醒小秘书软件的源代码
💻 CPP
字号:
//版权有所:李巧平    2003年1月份  电子邮件:liqiaoping@163.com  个人主页:http://mengyuworkroom.y365.com   QQ:5542376
// ShowMsg.cpp : implementation file
//

#include "stdafx.h"
#include "timerecord.h"
#include "ShowMsg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CShowMsg dialog
extern	CTimerecordApp	theApp;


CShowMsg::CShowMsg(CWnd* pParent /*=NULL*/)
	: CDialog(CShowMsg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CShowMsg)
	m_use = FALSE;
	//}}AFX_DATA_INIT
}


void CShowMsg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CShowMsg)
	DDX_Check(pDX, IDC_CHECK_USE, m_use);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CShowMsg, CDialog)
	//{{AFX_MSG_MAP(CShowMsg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CShowMsg message handlers

BOOL CShowMsg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	SetWindowPos(&CWnd::wndTopMost,0,0,0,0, SWP_NOMOVE | SWP_NOSIZE);
	// TODO: Add extra initialization here

	CString temp;
	CStringArray m_fileds,values;
	m_fileds.Add("titile");
	m_fileds.Add("text");
	m_fileds.Add("date");
	m_fileds.Add("time");

	char	msg[255];
	sprintf(msg,"where id=%s",id);
	if( theApp.m_pingdatabase->_selectDataFromDatabase("recordmsg",msg,&m_fileds,&values,1,msg) !=1)
	{
		temp.Format("%s",msg);
		AfxMessageBox(temp);
		return true;
	}
	SetDlgItemText(IDC_EDIT_TITILE,values.GetAt(0));
	SetDlgItemText(IDC_EDIT_TEXT,values.GetAt(1));
	temp.Format("%s %s",values.GetAt(2),values.GetAt(3));
	SetDlgItemText(IDC_EDIT_DATETIME,temp);

	m_use=true;
	UpdateData(false);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CShowMsg::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData(true);
	if(m_use)
	{
		CStringArray m_fileds,values;
		m_fileds.Add("use");
		values.Add("1");
		char	msg[255];
		sprintf(msg,"where id=%s",id);
		if( theApp.m_pingdatabase->_updateRecord("recordmsg",msg,&m_fileds,&values,1,msg) !=1)
		{
			CString temp;
			temp.Format("%s",msg);
			AfxMessageBox(temp);
			return;
		}
	}
	exitDialog();
	//CDialog::OnOK();
}

void CShowMsg::OnCancel() 
{
	// TODO: Add extra cleanup here
	OnOK();
	//CDialog::OnCancel();
}

void CShowMsg::exitDialog()
{
	CDialog::OnOK();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -