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 » Support for COleDocIpFrmWnd Collapse All
Subject Author Date
Sachin Gupta Jul 7, 2006 - 10:47 AM

Hi,

We are using a trial version of Prof-UIS 2.54 and have already placed a purchase order for the Prof-UIS 2.54.

The background
-------------------
1. We have a main application.
2. We have an additional application/ OLE component [We call it "Reports"].
3. This OLE component [Reports] is mean to be embedded within the main application and with that the toolbars and menubars of main application get replaced with that of OLE component. The OLE component has 2 toolbars and 1 menubar.
4. This all is working fine so far.
5. The above behavior is similar to opening Excel in Internet Explorer, where the toolbars/menubars of Excel can be seen on IE.

The problem:
---------------
1. Main application was integrated with Prof-UIS and both the Toolbars and Menubars have Office 2003 look
2. The OLE component was also integrated with Prof-UIS and when run in standalone, the toolbars and menubars work fine in Office 2003 look. This is because for standalone, the applications main frame is derived from CFrameWnd.
3. As suggested by Miscrosoft, OLE components must hame classes derived from CFrameWnd for standalone and from COleDocIpFrmWnd when using OLE.
4. The OLE component doesnt show up the toolbars and menubars in office2003 look when embedded in main application.
5. We could not find any sample also where Prof-UIS is used in similar fashion.

Please help.

Thanks,
Sachin

Technical Support Jul 10, 2006 - 9:32 AM

Please download an improved version of the DRAWCLI sample from our website. This application works both as an OLE container and as an OLE server. So you can insert a DRAWCLI Document object into an MS Word Document object to see how Prof-UIS control bars are working inside OLE in-place active frame windows.

Sachin Gupta Jul 12, 2006 - 4:13 PM

We used the sample application which was provided in the site as a reference for implementing Prof-UIS looks to application which implements OLE integration. In the sample application we found that CMainFrame derived from CExtNCW < CMDIFrameWnd > for container application and CDrawInPlaceFrame derived from COleIPFrameWnd for server application are defined in the same MainFrm.cpp. We also found that the server and container resources of the menu bars like IDR_MAINFRAME, IDR_DRAWCLTYPE, IDR_DRAWCLTYPE_CNTR_IP, IDR_DRAWCLTYPE_SRVR_EMB are available in the single resource of the sample application.

These resource Ids are added to the command manager through the command CmdManager->UpdateFromMenu in both the OnCreatefunction of CMainFrame class as well as OnCreateControlBars function of CDrawInPlaceFrame class as

    VERIFY( g_CmdManager->UpdateFromMenu( m_strCmdProfileName, IDR_MAINFRAME ) );
    VERIFY( g_CmdManager->UpdateFromMenu( m_strCmdProfileName, IDR_DRAWCLTYPE ) );

But in our case, We have CMainFrame derived CExtNCW < CFrameWnd > in MainFrm.cpp of Application1 and CSaRsInPlaceFrame derived from COleDocIPFrameWnd is defined in IpFrame.cpp of Application2.

The Container and server resources for the menu bar is also distributed in Application1 and Application2

IDR_CNTR_INPLACE, IDR_MAINFRAME defined in Application1
IDR_CNTR_INPLACE, IDR_MAINFRAME, IDR_SRVR_EMBEDDED, IDR_SRVR_INPLACE defined in Application2

And resources are loaded at runtime.

Since the resources are at different places, We had added Resources in Application1 to Command manager at MainFrm.cpp of APP1 and Resources in Application2 to Command Manager through IPFrame.cpp of App2 as

VERIFY(g_CmdManager->UpdateFromMenu(pApp->m_pszProfileName,IDR_MAINFRAME));
    VERIFY(g_CmdManager->UpdateFromMenu(pApp->m_pszProfileName,IDR_CNTR_INPLACE)); in App1 MainFrm.cpp

And

VERIFY(g_CmdManager->UpdateFromMenu(m_strCmdProfileName,IDR_MAINFRAME));    
VERIFY( g_CmdManager->UpdateFromMenu(m_strCmdProfileName,IDR_CNTR_INPLACE));
VERIFY( g_CmdManager->UpdateFromMenu(m_strCmdProfileName,IDR_SRVR_EMBEDDED));
    VERIFY( g_CmdManager->UpdateFromMenu(m_strCmdProfileName,IDR_SRVR_INPLACE));
    VERIFY(g_CmdManager->UpdateFromMenu(m_strCmdProfileName,IDR_CONTEXTMENU)); in App2 IpFrame.cpp

To be noted that:
IDR_CNTR_INPLACE has only a part of Menu bar and is different in App1 and App2.

All the required initializations like

    g_CmdManager->ProfileSetup( m_strCmdProfileName, m_hWnd );
    g_CmdManager->ProfileWndAdd( m_strCmdProfileName, pWndFrame->m_hWnd );

have been done in both the application.

App1 which is container application calls

if(!m_wndMenuBar.Create(NULL,this,IDR_MAINFRAME)) >> where m_wndMenuBar is derived from CExtMenuControlBar to create the Menubar.

Inspite of adding the Resource ID to the command mangaers, Prof-UIS look is not getting reflected in Menu bar of App1 when OLE application (App2) is opened. OLE Toolbars whose resources are in App2 is reflecting Prof-UIS look when opened from App1. We have been trying various cases but still we are not able to implement it in Menu bar.

We have referred our application with the sample application. The only major difference is about the resources and classed defined in two different applications.

Please note that Menu bar resources are not available statically at one application. Please help us out in this case.

Technical Support Jul 13, 2006 - 1:25 PM

The OLE client/server integration is supported by the OLE subsystem for the standard Windows menu line only. It is not possible to activate OLE object (or run constantly active OLE document) and replace standard Windows menu menu line with a custom control like the menu bar. When you embed an OLE object into a MS Office 2000/XP/2003/2007 application (Word or Excel) and activate this object, then the Office menu bar, toolbars (ribbon in Office 2007) become hidden and you can see the standard Windows menu line instead. So, the menu bar may be not acceptable for your OLE client/Server projects.