📄 hartransform.cpp
字号:
// harTransform.cpp: implementation of the CharTransform class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "harTransform.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CharTransform::CharTransform()
{
}
CharTransform::~CharTransform()
{
}
TCHAR* CharTransform::CharToTChar(char *source)
{
long iLen = 0;
iLen = MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,source, -1, NULL,0);
TCHAR* res = (TCHAR*)LocalAlloc(LMEM_ZEROINIT,((iLen+1)/4*4+4)*2);
if(!res)
{
int error = GetLastError();
return NULL;
}
int a= MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,source,-1,res,iLen);
int b = strlen(source);
return res;
}
char* CharTransform::TCharToChar(TCHAR *source)
{
int iLen = 0;
iLen = WideCharToMultiByte(CP_ACP,0,source, -1, NULL,0,NULL,NULL);
char* res = new char[(iLen+1)/4*4+4];
WideCharToMultiByte(CP_ACP,0,source, -1, res,iLen,NULL,NULL);
return res;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -