locked
how to use IInkOverlay in dialog based MFC Application for win mobile 6 RRS feed

  • Question

  • Hello !!

    I had used IInkOverlay for a SIP(Soft input panel), there it works fine. There in select() i created the instance of IInkOverlay and provided the windo hanhler to it, as

    hr= ::CoCreateInstance(CLSID_InkOverlay,NULL,CLSCTX_INPROC_SERVER,IID_IInkOverlay,void**&g_pInkOverlay);

    hr = g_pInkOverlay->put_hWnd((
    long)g_hwndMain);
    ASSERT(SUCCEEDED(hr));
    hr = g_pInkOverlay->put_Enabled(VARIANT_TRUE);
    ASSERT(SUCCEEDED(hr));


    but same way i tried it in my another application which is dialogbased MFC app(for winMobile6), there it fails . The CoCreateInstance returns g_pInkOverlay=NULL.
    Please tell me if im doing anything wrong or is there any other way to use WISP Lite.

     

    Wednesday, December 2, 2009 2:32 PM

Answers

  • Problem is solved!

    After calling CoInitializeEx(NULL,COINIT_MULTITHREADED); in initinstance() of the application, and removing the lineto() and moveto() from the moseevent handlers, now its working fine.
    • Marked as answer by punebrat Thursday, December 3, 2009 1:36 PM
    Thursday, December 3, 2009 1:35 PM

All replies

  • hello there!

    The HRUSULT return by CoCreateInstance() is "CoInitialize has not called".

    Brief About My App: Its A Dialog based Application, has a button within the main dialog. This button im using as the drawing area. And i want to pass the handler of this button to the IINKoverlay so the strokes will be handle by IINKOverlay.

    Where should i call CoInitialize();,
    Thursday, December 3, 2009 5:23 AM
  • Problem is solved!

    After calling CoInitializeEx(NULL,COINIT_MULTITHREADED); in initinstance() of the application, and removing the lineto() and moveto() from the moseevent handlers, now its working fine.
    • Marked as answer by punebrat Thursday, December 3, 2009 1:36 PM
    Thursday, December 3, 2009 1:35 PM