#include "stdafx.h" #include "AdoDef.h" CString IntToStr(int nVal) { CString strRet; char buff[10]; _itoa_s(nVal, buff, 10); strRet = buff; return strRet; } CString LongToStr(long lVal) { CString strRet; char buff[20]; _ltoa_s(lVal, buff, 10); strRet = buff; return strRet; } CString ULongToStr(unsigned long ulVal) { CString strRet; char buff[20]; _ultoa_s(ulVal, buff, 10); strRet = buff; return strRet; } CString DblToStr(double dblVal, int ndigits) { CString strRet; char buff[50]; //_gcvt(dblVal, ndigits, buff); _gcvt_s(buff, 50, dblVal, ndigits); strRet = buff; return strRet; } CString DblToStr(float fltVal) { CString strRet = _T(""); char buff[50]; //_gcvt(fltVal, 10, buff); _gcvt_s(buff, 50, fltVal, 10); strRet = buff; return strRet; }