3 #ifndef GET_SAFE_STRING
4 #define GET_SAFE_STRING(str) ( (str)?(str):_T("") )
9 #define _vsnprintf_hw _vsnwprintf_s
11 #define _vsnprintf_hw _vsnprintf_s
14 #define HANDLE_IS_VALID(h) ( (HANDLE)(h)!=NULL && (HANDLE)(h)!=INVALID_HANDLE_VALUE )
18 STRING_IS_MULTICHARS
= 0, // ÊǶà×Ö½Ú×Ö·û´®
19 STRING_IS_UNICODE
, // ÊÇUNICODE×Ö·û´®
20 STRING_IS_SOFTCODE
, // ÊǺͳÌÐòÒ»ÑùµÄ×Ö·û´®±àÂë
23 class CMultiByteString
26 CMultiByteString ( LPCTSTR lpszOrg
, int nOrgStringEncodeType
=STRING_IS_SOFTCODE
, OUT
char *pOutBuf
=NULL
, int nOutBufSize
=0 );
30 if ( m_pszData
) return m_pszData
;
36 return m_nCharactersNumber
;
38 // »ñÈ¡×Ö·û´®Õ¼ÓÃÄÚ´æ´óС£¨×Ö½ÚÊý£¬°üÀ¨×Ö·û´®½áÊøµÄ'\0'ËùÕ¼µÄλÖã©
44 char *m_pszData
; // ±£´æÄ¿±ê×Ö·û´®µÄ»º³å
45 int m_nDataSize
; // Ä¿±ê×Ö·û´®Õ¼ÓõÄÄÚ´æ´óС£¨×Ö½ÚÊý£¬°üÀ¨×Ö·û´®½áÊøµÄ'\0'£©
46 int m_nCharactersNumber
; // Ä¿±ê×Ö·û´®µÄ¸öÊý
47 BOOL m_bNewBuffer
; // ÊÇ·ñÔÚÕâ¸öÀàÖÐÉêÇëÁËÄÚ´æ
50 CString
GetCompatibleString ( LPVOID lpszOrg
, BOOL bOrgIsUnicode
, int nOrgLength
=-1 );
51 CString
FormatDateTime ( COleDateTime
&DateTime
, LPCTSTR pFormat
);
52 CString
FormatString ( LPCTSTR lpszStr
, ... );
53 int hwGetFileAttr ( LPCTSTR lpFileName
, OUT CFileStatus
*pFileStatus
=NULL
);
54 CString
FormatBytes ( double fBytesNum
, BOOL bShowUnit
=TRUE
, int nFlag
=0 );
55 BOOL
WaitForThreadEnd ( HANDLE
*phThread
, DWORD dwWaitTime
=10*1000 );
57 //{{AFX_INSERT_LOCATION}}
58 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.