• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

Ole Server not visible when I embed it in a container

I am trying to create an OLE Server object.  The view is based on the CListView class.

In the document I am populating the list view in report format with my data.

However, when I embed the object in excel or word, the object disappears when I click off the server object.  
I know that I am suppose to use the OnDraw() of the COleServerItem class, but how do I explicitly draw the list view control.
In my view class, this is all taken care of since its derived from CListView.  It is not an owner-drawn list view.

Any help is appreciated.
1 Solution
Try the following inside OnDraw:

void CMyServerItem::OnDraw(CDC* pDC, const CRect& rcBounds .... // whatever the OnDraw method is declared
    m_mylistctrl.SendMessage(WM_PAINT, (WPARAM)pDC->m_hDC, 0);
    m_mylistctrl.SendMessage(WM_PRINT, (WPARAM)pDC->m_hdc, PRF_CLIENT);


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now