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

📄 dateutil.cpp

📁 API经典入门
💻 CPP
字号:
// This file contains the implementations for utilities 
// relating to CDate.
// Filename : DateUtil.cpp

#include "stdafx.h"
#include "DateUtil.h"

void AFXAPI DDX_Text(CDataExchange* pDX, int nIDC, CDate& value)
{
	HWND hWndCtrl = pDX->PrepareEditCtrl(nIDC);
	CString tempS;
	
	if (pDX->m_bSaveAndValidate)
	{
		int nLen = ::GetWindowTextLength(hWndCtrl);
		::GetWindowText(hWndCtrl, tempS.GetBufferSetLength(nLen), nLen+1);
		if (tempS.IsEmpty())
			value = CDate(); // Null date
		else if (!value.StringToDate(tempS))
		{
			AfxMessageBox("Invalid Date!");
			tempS.Empty();
			// Fail will throw an exception whose alternate
			// flow of control will bypass the normal end-scope
			// clean-up.  Therefore we must manually destroy
			// dynamic objects like CString.
			pDX->Fail();
		}
	}
	else
	{
		::SetWindowText(hWndCtrl, value.DateString());
	}
}

⌨️ 快捷键说明

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