user3026374
user3026374

Reputation: 15

Detect mouse click in mfc/ole

I am trying to implement a mouse click using mfc in an existant software. The client is a mfc application that is connected to a server through OLE automation. The client display the output of a server that is connect to through OLE. I used the wizared to implement the detection of the mouse click by the client:

    void CChildView::OnLButtonDown(UINT nFlags, CPoint point)
    {
        CDC* pDC1 = GetDC();
        pDC1->SelectStockObject(WHITE_BRUSH);
        pDC1->Ellipse(0,0,20,20);
    }

I was expecting that when I click, a small circle will appear. But it doesn't work, I can see only the output of the server! When I implement this in a simple independent project, it works. I would appreciate your help to solve this. Thanks! L.

Upvotes: 0

Views: 835

Answers (1)

ScottMcP-MVP
ScottMcP-MVP

Reputation: 10425

If the video is being painted directly on CChildView then it will overwrite and erase the circle very quickly. If the video is being painted by a child control of some kind on the CChildView then the mouse click message goes to that control, not to CChildView.

Upvotes: 1

Related Questions