CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2003
    Posts
    18

    MouseWheel event not getting in COM Object dll

    Hi,
    I am having a com dll object .
    This object is used in one of my applications. This object is having scrollbar in it.

    I have added message handler for WM_MOUSEWHEEL. But still I am no able to receive this event in my COM object.

    My COM object is already responding to WM_VSCROLL, WM_HSCROLL messages.

    I added a new message handler for WM_SETFOCUS message similar to the way I added for WM_MOUSEWHEEL. I am able to execute the functions in OnSetFocus(). But my code in OnMouseWheel() function is not getting executed.

    Any idea why I am not able to receive WM_MOUSEWHEEL message in my COM object. Can you please help me solve this problem.

    Code snippet i used is given below.


    In Com DLL .h file
    -----------------------------
    BEGIN_MSG_MAP(CCtl)
    MESSAGE_HANDLER(WM_HSCROLL, OnHScroll)
    MESSAGE_HANDLER(WM_VSCROLL, OnVScroll)
    MESSAGE_HANDLER( WM_SETFOCUS,OnSetFocus)
    MESSAGE_HANDLER(WM_MOUSEWHEEL, OnMouseWheel)
    END_MSG_MAP()


    private:
    LRESULT OnHScroll(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
    LRESULT OnVScroll(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
    LRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
    LRESULT OnMouseWheel(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

    Also Implemented these functions in the cpp file.

    For WM_MOUSEWHEEL do I need to handle it in a different way?Please guide me.

    Thanks in Advance
    Vin

  2. #2
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: MouseWheel event not getting in COM Object dll

    Do other application like Internet Explorer respond to mouse wheel on your computer ?
    Regards,
    Ramkrishna Pawar

  3. #3
    Join Date
    Sep 2003
    Posts
    18

    Re: MouseWheel event not getting in COM Object dll

    Other applications are able to get MouseWheel event.

  4. #4
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: MouseWheel event not getting in COM Object dll

    Is that code you manually added ?
    Regards,
    Ramkrishna Pawar

  5. #5
    Join Date
    Sep 2003
    Posts
    18

    Re: MouseWheel event not getting in COM Object dll

    The code for WM_MOUSEWHEEL is manually added by me.

  6. #6
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: MouseWheel event not getting in COM Object dll

    Can you attach your source code here ?
    Regards,
    Ramkrishna Pawar

  7. #7
    Join Date
    Sep 2003
    Posts
    18

    Re: MouseWheel event not getting in COM Object dll

    It ia actually a big application. So it is difficult to attach the source code.

    Any idea why this problem is happening.?

    Thanks
    Vin

  8. #8
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: MouseWheel event not getting in COM Object dll

    Realy cant say anything, usually just a handler for WM_MOUSEWHEEL is needed in order to support the wheel movements.
    Regards,
    Ramkrishna Pawar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured