Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - OLE Inplace Menu doesn't work for MDI applications
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

OLE Inplace Menu doesn't work for MDI applications

 Post Reply Post Reply
Author
Message
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Topic: OLE Inplace Menu doesn't work for MDI applications
    Posted: 17 November 2006 at 10:38am
Hello,
 
Your sample MFC (Codejock TookKit Pro Version 10.3.1) Command Bars Samples - Smart Layout, doesn't work with OLE Inplace editing.
 
To produce this bug : Launch your sample and drag'n'drop a MS Word .DOC document inside of the text editor. Now double-clic on the newly inserted OLE element, you won't see the OLE menu of MS Word.
 
Your sample User Interface Samples - Office 2003 GUI works fine.
 
The main difference between these two applications is that the first one is a MDI based frame and the second one is a SDI.
 
Could you please help us to solve this issue, as we have the same problem in our application. What should we change to make it working ?
 
Thank you in advance !
Regards,
Sergio
Back to Top
Oleg View Drop Down
Admin Group
Admin Group
Avatar

Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2006 at 3:04am
Hello,
See code of void CDrawItem::ActiveStateChanged(BOOL bActive)
in DrawClient sample.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2006 at 5:21am
Thank you for your prompt answer, I'm currently looking at the DrawClient sample and changing my code.
 
You sample has a little bug when doing a Print Preview (using the OLE main menu), after having entered and exited a few times from the In Place editing.
 
Here is a Print Screen :
 
 
Some buttons in the Main Menu are repeated.
 
Regards,
Sergio
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2006 at 5:37am

The problem of duplicates doesn't occur in my code, it's okay, it occurs only in your sample.

We have integrated the code of your sample, the OLE menu works now fine. But after leaving the In Place edit mode, our custom docking panes (a CWnd* Attached to a CXTPDockingPane through the method pDockPane->Attach(pMyWnd)) are empty. The attached window seems to have been destroyed, the docking panes are empty.
 
Could you help us ?
 
Sergio
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2006 at 6:01am

Try it, just paste the following code to the end of the method CMainFrame::OnCreate(...) of your Draw Client sample :

CXTPDockingPane* pPaneLog = m_paneManager.CreatePane( 10, CRect( 0, 0, 200, 200 ), xtpPaneDockBottom );

static CEdit edit;

edit.Create( WS_CHILD | WS_VISIBLE, CRect(0,0,1,1), this, 100 );

edit.SetWindowText( _T("Text Edit Contents !") );

pPaneLog->Attach( &edit );

pPaneLog->SetTitle( _T("Hello World") );

m_paneManager.ToggleDocking( pPaneLog );

 
Now, launch the sample, and insert an OLE item, start editing In Place, and leave editing. You will see that the undocked pane is now empty !!!
 
Please help us !
Sergio
Back to Top
Oleg View Drop Down
Admin Group
Admin Group
Avatar

Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2006 at 6:37am
Hello,
You must call Attach in OnDockingPaneNotify method.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2006 at 10:00am
Hello,
 
This way is not really suitable for us, as not only the contents of the docking pane is destroyed, but also the docking pane itself and it is recreated using a different pointer.
 
The big problem is that after ending editing In Place, the layout is not restored as it was before, because all the controls have been recreated and the scrollbars, the focus, expanded tabs in tree controls, etc. are not as they were before.
 
Moreover we store a pointer to the docking pane in the OnCreate(...) method of the MainFrame and it is destroyed/changed by Codejock. The docking panes aren't all recreated at the same time (because the creation is made after selecting an hidden docking pane), this causing memory access violation.
 
Why don't you simply detach your docking panes or change parent ? Our docking panes contain logs that are continuously updated.
 
Sergio
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2006 at 10:28am
Hello Oleg,
 
Finally, we managed it differently. Now it works fine, the contents controls seems to keep their state, it's just the pointer to the docking pane that's change.
 
We have made a method that update all the pointers :
 

void C...MainFrame::UpdateDockingPanesPointers()

{

m_pDockingPaneFolderTreeCtrl = m_paneManager.FindPane( IDC_FOLDERS_TREE );

m_pDockingPaneFolderContentLog = m_paneManager.FindPane( IDC_LOG );

m_pDockingPaneFolderContentFolder = m_paneManager.FindPane( IDC_FOLDER );

m_pDockingPaneFolderContentSearch = m_paneManager.FindPane( IDC_SEARCH );

m_pDockingPaneFolderContentFinancial = m_paneManager.FindPane( IDC_FINANCIAL_LOG );

}

 
Thank you for your help, you can mark this topic as closed.
 
Best Regards,
 
Sergio
Back to Top
Oleg View Drop Down
Admin Group
Admin Group
Avatar

Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2006 at 10:37am
Hi,
 
Don't forget that after each Load call m_pDockingPaneXXX will be not valid also.
 
Instead saving pointers as member, I recommend just use FindPane when you need to get pointer.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 29 November 2006 at 4:56am
I have removed all my m_pDock.... pointers, and converted them into GetDock...() methods.
 
Now it's all working fine in all cases !
 
Thanks !
Best Regards,
Sergio
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.094 seconds.