none
GetGestureInfo fails in link with MFC application Windows Embedded CE 6.0 R3 RRS feed

  • Question

  • Hi there,

    I'm currently testing the gesture API in CE 6.0 R3.

    Today I discovered a strange phenomenon. I have a small window based test application (without MFC). Right there GetGestureInfo succeedes. I then made a small MFC doc based application. I overwrote PreTranslateMessage within CMainFrame in order to handle the WM_GESTURE messages. The messages are getting received though GetGestureInfo fails. GetLastError returns 57 which indicates that something went wrong on a network interface?

    It's pretty strange, EnableGestures and CloseGestureInfoHandle succeed. I noticed that the WM_GESTURE messages are getting received even if EnableGestures is not called. I therefore did some tests with other parameters on EnableGestures. But nothing helped. Right now EnableGestures is getting called like this:

    EnableGestures(m_pMainWnd->m_hWnd, TGF_GID_ALL, TGF_SCOPE_PROCESS)

    Does anybody have some experiences with gesture API?

    Any help would be appreciated.

    Best regards,
    Peter

    Thursday, November 14, 2013 12:53 PM

Answers

  • Got it :-)

    Overwriting the ...
    virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
    ... solved the task.

    Overwriting PretranslateMsg seems to be wrong in this case.

    • Marked as answer by pkuebler Thursday, November 14, 2013 2:03 PM
    • Unmarked as answer by pkuebler Tuesday, November 19, 2013 1:04 PM
    • Marked as answer by pkuebler Tuesday, November 19, 2013 1:04 PM
    Thursday, November 14, 2013 2:03 PM

All replies

  • Got it :-)

    Overwriting the ...
    virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
    ... solved the task.

    Overwriting PretranslateMsg seems to be wrong in this case.

    • Marked as answer by pkuebler Thursday, November 14, 2013 2:03 PM
    • Unmarked as answer by pkuebler Tuesday, November 19, 2013 1:04 PM
    • Marked as answer by pkuebler Tuesday, November 19, 2013 1:04 PM
    Thursday, November 14, 2013 2:03 PM
  • Are you sure that's not hex 57? Hex 57 = decimal 87 which is Invalid Parameter...

    Paul T.

    Thursday, November 14, 2013 3:50 PM
  • Thanks Paul. You were right. GetLastError returns 87.

    I've been calling GetGestureinfo with pMsg->lParam (from PreTranslateMessage(MSG* pMsg)). lParam differs between PreTranslateMessage and WindowProc.

    Tuesday, November 19, 2013 1:04 PM