|
BOOL CMaindlg::Create(void){ HXMLRES hRes = XXmlRes_Load(_T("res\\resource.res")); if (NULL != hRes) { m_hWindow = XC_LoadXML_Window(_T("res\\layout.xml"),hRes); XC_LoadXML_Style(m_hWindow,_T("res\\style.css"),hRes); } GethWnd(hRes); SetEvent();
XWnd_ShowWindow(m_hWindow,SW_SHOW); XXmlRes_Destroy(hRes);
return TRUE;}
void CMaindlg::GethWnd(HXMLRES hRes){ m_btnok = XWnd_GetEle(m_hWindow,XXmlRes_FindId(hRes,_T("ID_BTN_OK"))); m_edtinput = XWnd_GetEle(m_hWindow,XXmlRes_FindId(hRes,_T("ID_EDT_INPUT")));
}
void CMaindlg::SetEvent(void){ XCGUI_RegEleEvent(m_btnok,XE_BNCLICK,&CMaindlg::EventBtnClick);}
BOOL CMaindlg::EventBtnClick(HELE hEle,HELE hEventEle){ XMessageBox(hEle,L"你点击了按钮",L"提示",XMB_OK | XMB_CANCEL); return TRUE;}
main 函数:
XInitXCGUI();
CMaindlg MyWnd; if(MyWnd.Create()) { XRunXCGUI(); }
点击按钮触发XE_BNCLICK 事件之后 会出现以下错误....
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
|
|