본문 바로가기

Windows/MFC

String convert macro

CONST TCHAR -> ASCII : T2CA(str)

매크로가 있더라..

[code]example[/code]

USES_CONVERSION;    // 반드시 상단에 기입!

//
// gzFile -> voidp 이다.
//
gzFile zfp;
int n;
TCHAR buf[256] = {0, };
int lerrno;

if (!IsFile())
{
    return false;
}

int fh;
::_tsopen_s(&fh, static_cast<LPCTSTR>(m_szFileName), _O_RDONLY, _SH_DENYNO, _S_IREAD);

if ((zfp = ::gzopen(T2CA(m_szDestinationFile), "wb")) == NULL)
{
    return false;
}