VC++小知识积累

①整形(int)转化为字符串型(CString)
 //变量定义
 private:
  int m_iRandom;
  CString m_sRandom;
 //int类型转换为CString类型
  m_sRandom.Format("%d",m_iRandom);

②//获取系统当前时间
 CTime tm;
 tm=CTime::GetCurrentTime();
 m_sCurrentTime=tm.Format("%Y-%m-%d %X");

 

③CString类型转换为long类型

CString m_CardCode;

long lCardCode=  atof(m_CardCode); 

posted on 2009-07-08 18:30  一路前行  阅读(245)  评论(0编辑  收藏  举报