1. 错误:
module machine type 'ARM' conflicts with target machine type 'X86'
Platform : Pocket PC 2003(ARMV4).
C/C++ --> Advanced --> Compile for Architecture --> ARM4(QRarch4)
Linker --> Advanced --> Target Machine --> Machine ARM (/MACHINE:ARM)
问题解决了,方法是修改link command,Machine 改为ARM
/ALIGN:4096 /subsystem:$(CESubsystem) /MACHINE:ARM
2. serial port 工程中 winuser.h 文件
#ifdef UNICODE
#define GetWindowText GetWindowTextW
(1)定义一个全局变量 :HWND hwndSText; // 发送区 文本句柄
(2)初始化时 LONG DoInit(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam)
// 获取 发送区的句柄
hwndSText = GetDlgItem (hwnd, ID_SENDTEXT);
(3) 写数据
SetWindowText(hwndSText,szTempText);
(4) 读数据
GetWindowText(句柄,数据首地址,数据长度);
参考
int GetWindowTextW(HWND hWnd,LPWSTR lpString,int nMaxCount);
WCHAR szText[TEXTSIZE]; //发送数据 缓冲区
GetWindowText (hwndSText, szText, dim(szText));
对于LPWSTR 格式:
InitCommunication(TEXT("COM3:")); TEST 宏定义 在winuser.h 文件 中有定义
InitCommunication(LPWSTR pdevname);
(5) Edit_SetText(GetDlgItem(hDlg,ID_SENDTEXT),TEXT("UART TEST\r"));
/****** Edit control message APIs ********************************************/
#define Edit_Enable(hwndCtl, fEnable) EnableWindow((hwndCtl), (fEnable))
#define Edit_GetText(hwndCtl, lpch, cchMax) GetWindowText((hwndCtl), (lpch), (cchMax))
#define Edit_GetTextLength(hwndCtl) GetWindowTextLength(hwndCtl)
#define Edit_SetText(hwndCtl, lpsz) SetWindowText((hwndCtl), (lpsz))
阅读(1569) | 评论(0) | 转发(0) |