简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM