Ole Server not visible when I embed it in a container

Posted on 2005-04-22
Last Modified: 2013-11-20
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.
Question by:wzhxxj
    1 Comment
    LVL 6

    Accepted 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

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    if loop error 4 68
    Question regarding Copy/Paste 16 83
    Path of Workbook 3 30
    Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seveā€¦
    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now