Re: VC++ Tips & Tricks Hi All,
Here is the tip for TCHAR conversion in Visual C++. I have given the sample conversion program source code. TCHAR convertion
TCHAR szCurDir[MAX_PATH];
wsprintf(szCurDir,"%s",dFile);
szCurDir[dFile.GetLength()+1]='\0';
USHORT m_Length = strlen(szCurDir);
WCHAR *m_Buffer = (LPWSTR)malloc((m_Length + 1) * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, szCurDir, m_Length, m_Buffer, m_Length);
m_Buffer[m_Length] = L'\0'; thanks 
__________________ Karpagarajan. R Necessity is the mother of invention
Last edited by Booom : 08-09-2007 at 04:37 AM.
|