LPWSTR GB2312ToUnicode(LPCSTR lpszInBuf){ if(NULL == lpszInBuf) { return NULL; } WCHAR* pBuf = NULL; int nLen = MultiByteToWideChar(CP_ACP, 0, lpszIn....
分类:
Web程序 时间:
2015-10-22 19:08:01
阅读次数:
259
WCHAR pFileName[MAX_PATH] = {0}; //得到程序自身的全路径 DWORD dwRet = GetModuleFileName(NULL, pFileName, MAX_PATH); HKEY hKey; RE...
分类:
编程语言 时间:
2015-10-08 18:04:48
阅读次数:
196
//#include "targetver.h"#include "stdio.h"#include #include int GetProcessIdByName(WCHAR* Namestr) //进程名取pid{ HANDLE hSnapshot; PROCESSENTRY32 p...
分类:
系统相关 时间:
2015-09-21 15:49:14
阅读次数:
173
1 #include 2 #include 3 #include "iostream" 4 using namespace std; 5 void PASS_TPTHREAD(WCHAR ProcessName[]); 6 typedef LONG NTSTATUS; 7 typedef NT...
分类:
编程语言 时间:
2015-09-21 15:36:40
阅读次数:
297
CFile file; CString str1= L"写入文件成功!"; wchar_t *str2; if (!file.Open(L"Hello.txt", CFile::modeReadWrite| CFile::modeRead)) { AfxMess...
分类:
其他好文 时间:
2015-09-21 15:34:05
阅读次数:
186
strcpy宽字符拷贝,总是记不住wcscpy wchar_t wbuf[255]; String s1="中国"; wcscpy(wbuf,s1.c_str());
分类:
其他好文 时间:
2015-09-11 18:59:56
阅读次数:
110
int GetEncoderClsid(const WCHAR* format, CLSID* pClsid){ UINT num = 0; UINT size = 0; ImageCodecInfo* pImageCodecInfo = NULL; Gdiplus::GetImageEncoder...
一旦知道 TCHAR 和_T 是如何工作的,那么这个问题很简单。基本思想是 TCHAR 要么是char,要么是 wchar_t,这取决于_UNICODE 的值:// abridged from tchar.h #ifdef _UNICODE typedef wchar_t TCHAR; ...
分类:
编程语言 时间:
2015-08-17 11:22:39
阅读次数:
131
实现宽字符的拷贝与计算宽字符的长度
int mywcslen(wchar_t *wstr)
{
int i = 0;
while (*wstr!=L'\0')
{
i++;
wstr++;
}
return i;
}
wchar_t *mywcscpy(wchar_t *dest, const wchar_t *source)
{
if (NULL==dest||NULL==...
分类:
其他好文 时间:
2015-08-16 07:11:15
阅读次数:
483
实现宽字符串的逆转//将空格处理成字符串结束标志
void set0(wchar_t wstr[20])
{
wchar_t *p = wstr;
while (*p != L'\0')
{
if (*p == L' ')
{
*p = L'\0';
}
p++;
}
}
//结束标志各位空格
void set1(wchar_t wstr[...
分类:
其他好文 时间:
2015-08-15 23:04:50
阅读次数:
138