|
发表于 2017-8-18 16:16:07
|
显示全部楼层
回 novice 的帖子
novice:首先WM_HWIN _MESSAGEBOX_Create不能用static修饰,因为static限定变量、函数在本文件范围内。
方法1
在头文件中声明:
WM_HWIN _MESSAGEBOX_Create(const char * sMessage, const char * sCaption, const GUI_FONT * pFont);
然后在*.c/cpp文件中#include这个头文件。
....... (2017-08-18 16:05)  static WM_HWIN _MESSAGEBOX_Create(const char * sMessage, const char * sCaption, const GUI_FONT * pFont) {
WM_HWIN hWin;
WM_HWIN hItem;
GUI_RECT Rect;
hWin = MESSAGEBOX_Create(sMessage, sCaption, 0);
FRAMEWIN_SetFont(hWin, pFont);
WM_GetWindowRectEx(hWin, &Rect);
FRAMEWIN_SetTextAlign(hWin, GUI_TA_HCENTER);
WM_SetWindowPos(hWin,
59, 62,
195, 125);
hItem = WM_GetDialogItem(hWin, GUI_ID_TEXT0);
TEXT_SetFont(hItem, pFont);
WM_SetWindowPos(hItem,
65, 88,
195, 125);
hItem = WM_GetDialogItem(hWin, GUI_ID_OK);
WM_SetWindowPos(hItem, 114,
156,
80,
20);
// return hWin;
}
函数在本文件范围内是正常,要是使用方法1,2 都是报错的 |
|