posts - 5, comments - 8, trackbacks - 0, articles - 0

09 2008 档案

摘要: 1.头文件中要定义宏; #define UNICODE #define _UNICODE //////////////////// char buf[128]; memset(buf,0,128); strcpy(buf,"你好"); WCHAR pCName[128]; memset(pCName,0,128); MultiByteToWideChar(CP_THREAD_ACP,MB_USEGLYPHCHARS,buf,strlen(buf),pCName,128); 至于WCHAR 转换到CHAR,则用 WideCharToMultiByte ////////////////////////// 2.char转换成wchar const char *pFilePathName = "c:\\aa.dll"; int nLen = s阅读全文

posted @ 2008-09-25 12:01 黄美华 阅读(1567) | 评论 (0) 编辑 |

摘要: #include "stdafx.h" #include "ras.h" HANDLE hPort = INVALID_HANDLE_VALUE; HRASCONN hRasConn = NULL; BOOL CreatePort() { DWORD dwNumBytesWritten; BOOL fRet; BYTE Bytes[]={'A','T','+','C','G','D','C','O','N','T','=','1',',','"','I','P','"',',','"','C','M','N','E','T','"',0x0D,'A','T','D','T','*','9','9','#',0x0D}; //open the serial port hPort = CreateFile(TEXT("COM8:"),GENERIC_READ | GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL); if ( hPort == INVALID_HANDLE_VALUE ) { /阅读全文

posted @ 2008-09-16 10:00 黄美华 阅读(1528) | 评论 (0) 编辑 |