Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » DrawCli and OLE Objects Collapse All
Subject Author Date
Vityusha Vinokurov Apr 5, 2005 - 6:21 AM

When I insert Word 2002 as OLE object into DrawCli example and close In-place editor by ESC Word 2002 crash. Seems this happen becouse CDrawItem::OnDeactivateUI(BOOL bUndoable) send message to Cview class to close already closed item. I don’t know why Word 2002 item have at this point active state and why it crash.


When I remove sending this message from CDrawItem::OnDeactivateUI(BOOL bUndoable) (remove pView->PostMessage(WM_COMMAND,ID_CANCEL_EDIT);  line) Word don’t crash anymore. But if I have WordPad or Paintbrush OLE objects and close inplace editor with this objects by ESC two menus appears in DrawCli - one is the Prof-UIS menubar and ont is the standard application menu. Pressing ESC once else close standard application menu (by CDrawView::OnCancelEdit() function).


Are ther? any solutions to fix this problem?

Technical Support Apr 6, 2005 - 3:37 AM

Thank you for the bug information. We have not finally found what causes this bug, but it seems this version of the CDrawItem::OnDeactivateUI() method of the DRAWCLI sample fixes this problem:

void CDrawItem::OnDeactivateUI(
    BOOL bUndoable
    )
{
    CFrameWnd * pFrame =
        STATIC_DOWNCAST(
            CFrameWnd,
            ::AfxGetMainWnd()
            );
    ASSERT_VALID( pFrame );
    pFrame->SendMessage(
        WM_SETMESSAGESTRING,
        (WPARAM)AFX_IDS_IDLEMESSAGE
        );
    COleClientItem::OnDeactivateUI(
        bUndoable
        );
    DWORD dwMisc = 0;
    m_lpObject->GetMiscStatus(
        GetDrawAspect(),
        &dwMisc
        );
    if( dwMisc & OLEMISC_INSIDEOUT )
        DoVerb( OLEIVERB_HIDE, NULL );
    pFrame->DelayRecalcLayout();
    pFrame->SetMenu( NULL );
}