简体   繁体   中英

Call of Dialog.DoModal with ATL does not work on Windows CE 6.0

We've got an application for Windows CE and Windows Mobile. Inside this Application a Dialog should be shown if a button in a toolbar is pressed. This works pretty well Windows CE 7 and Windows Mobile 6.5.3 but for some reason it won't work on Windows CE 6.0. We are using the ATL- and WTL-Library for implementation.

Here's the code for calling

LRESULT CMainWindow::OnSettings(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL      &bHandled) {    
    this->settingsWnd.DoModal(this->m_hWnd);
return S_OK;
}

I've debuged it down do the place were the error occurs.

It goes from

ATL::CAxDialogImpl:DoModal(HWND hWndParent, LPARAM dwInitParam)

over

ATLINLINE ATLAPI_(INT_PTR) AtlAxDialogBoxW(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogProc, LPARAM dwInitParam)

to

typename Helper::ReturnType AtlAxDialogCreateT(HINSTANCE hInstance, StringType lpTemplateName, HWND hWndParent, DLGPROC lpDialogProc, LPARAM dwInitParam)

here following call

nRet = (*pFunc)(hInstance, lpDialogTemplate, hWndParent, lpDialogProc, dwInitParam);

is returning -1 as a result and the calling is canceled. On the other OS this does not happen.

Has anyone an idea what could be the cause of this behaviour?

Edit 10.10.14: This is a except from our recource script which es working on CE 7 and ME 6.5.3

IDD_SETTINGS DIALOG  0, 0, 156, 169
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION
CAPTION "Einstellungen"
FONT 8, "MS Sans Serif"
BEGIN
    CONTROL         "",IDC_TAB1,"SysTabControl32",0x0,7,7,142,137
    PUSHBUTTON      "Cancel",IDCANCEL,93,148,56,16
    DEFPUSHBUTTON   "OK",IDOK,7,148,56,16
END

IDD_SETTINGS_HP DIALOG  0, 0, 128, 119
STYLE DS_SETFONT | WS_CHILD
FONT 8, "Tahoma"
BEGIN
    EDITTEXT        IDC_HOMEPAGE,7,16,115,13,ES_AUTOHSCROLL
    EDITTEXT        IDC_TIMEOUT,88,33,34,13,ES_AUTOHSCROLL
    EDITTEXT        IDC_TRYTIMES,103,50,19,12,ES_AUTOHSCROLL | ES_NUMBER
    EDITTEXT        IDC_HOMEPAGE2,7,76,115,13,ES_AUTOHSCROLL
    EDITTEXT        IDC_HOMEPAGE3,7,102,115,13,ES_AUTOHSCROLL
    LTEXT           "Homepage (Main Server)",IDC_STATIC,7,6,80,8
    LTEXT           "Homepage (Backup Server 1)",IDC_STATIC,7,66,94,8
    LTEXT           "Homepage (Backup Server 2)",IDC_STATIC,7,92,94,8
    LTEXT           "Times to try before switching",IDC_STATIC,7,51,93,8
    LTEXT           "Connection Timeout (ms)",IDC_STATIC,7,35,80,8
END

使用InitCommonControlsEx (ICC_TAB_CLASSES)初始化选项卡控件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM