[table=98%,rgb(232, 232, 232)]
[tr][td]大家好:
我先创建A对话框,然后创建B对话框,在B对话框里面关闭A对话框.
然后创建A对话框,创建完成后再关闭B对话框.这样操作几次以后发现Emwin异常了(界面错误并且不响应),但是没有完全死掉.
我跟踪代码发现关闭对话框没有成功,麻烦帮忙看看.
下面是部分代码:
void Emwin_Main_Init(void)
{
WM_HWIN hItem;
hWin_Main = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
hItem = WM_GetDialogItem(hWin_Main, ID_BUTTON_MAIN_MENU);
WM_SetFocus(hItem);
if(hWin_Menu)
{
GUI_EndDialog(hWin_Menu,0);
WM_DeleteWindow(hWin_Menu);
}
}
void Emwin_Menu_Init(void)
{
WM_HWIN hItem;
hWin_Menu = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
hItem = WM_GetDialogItem(hWin_Menu, ID_BUTTON_MENU_WIFI);
WM_SetFocus(hItem);
if(hWin_Main)
{
GUI_EndDialog(hWin_Main,1);
WM_DeleteWindow(hWin_Main);
}
}
|