C++
cui412445112
这个作者很懒,什么都没留下…
展开
-
C++代码中使用C#的DLL
#using "***.dll" //调用C# DLLusing namespace TeachMidDll;gcroot<TeachMidDll::Teach^> Teach_demo;bool bResult = Teach_demo->closeCOM();//调用DLL内方法然后项目设置页->配置属性->常规->公共语言运行时支持 设置为 “公共语言运行时支持(/clr)”调用C#的原创 2015-12-10 13:57:33 · 248 阅读 · 0 评论 -
C++通过ANE发送中文字符串到AS防止乱码的处理
char* GBKToUTF8(const char* strGBK){ int len=MultiByteToWideChar(CP_ACP, 0, (LPCTSTR)strGBK, -1, NULL,0); unsigned short * wszUtf8 = new unsigned short[len+1]; memset(wszUtf8, 0, len * 2 +原创 2015-12-10 14:08:25 · 329 阅读 · 0 评论 -
C++获取可使用的COM口列表
int iCOM; char cCom[MAX_PATH] = " "; bool bFirstTime = TRUE; for(int i = 1; i<=iCOM; i++) { HANDLE hCom; //全局变量,串口句柄 char cTemp[MAX_PATH]; char cTempFull[MAX_原创 2015-12-10 14:10:23 · 6623 阅读 · 0 评论 -
C++ 判断char* 是否为空
const char *cRec = "123" if(cRec && *cRec != '\0') { }原创 2015-12-10 14:21:50 · 20502 阅读 · 0 评论 -
UTF8toGBK
char* U2G(const char* utf8){int len = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, NULL, 0);wchar_t* wstr = new wchar_t[len+1];memset(wstr, 0, len+1);MultiByteToWideChar(CP_UTF8, 0, utf8, -1, wstr, l原创 2015-12-16 14:44:53 · 581 阅读 · 0 评论 -
char* GBKToUTF8(const char* strGBK)
char* GBKToUTF8(const char* strGBK){ int len=MultiByteToWideChar(CP_ACP, 0, (LPCTSTR)strGBK, -1, NULL,0); unsigned short * wszUtf8 = new unsigned short[len+1]; memset(wszUtf8, 0, len * 2 +原创 2015-12-16 14:29:10 · 947 阅读 · 0 评论