摘要: C2W char->wchar_tW2C wchar_t->char注意 codpage参数选择CP_OEMCP这样中文和英文都可以成功转换,如果只要转换英文可以使用CP_ACPbool C2W(const char* str,wchar_t* wstr){int len=MultiByteToWideChar(CP_OEMCP,0,str,-1/*null terminated*/,wstr,0);return len==MultiByteToWideChar(CP_OEMCP,0,str,-1/*null terminated*/,wstr,len);}bool W2C(con 阅读全文
posted @ 2011-05-06 21:25 OYJJ 阅读(1044) 评论(0) 推荐(0) 编辑