• MFC: OnMoving() not being called

    From Nightfox@VERT/DIGDIST to All on Wednesday, October 26, 2011 16:54:35
    Hi all -

    I'm working on a dialog-based Windows application using MFC and C++. Microsoft's documentation says OnMoving() should be called when the user is moving the window, and OnMove() should be called after the window has been moved: http://msdn.microsoft.com/en-us/library/31edwbbz(v=vs.80).aspx http://msdn.microsoft.com/en-us/library/a4y2xc1b(v=vs.80).aspx
    My main GUI class is derived from CDialogEx, and I've implemented OnMove() and OnMoving() in my class with the same signature as described in the documentation. However, those two functions are not being called when the GUI is moved. It's strange, because there's another dialog-based application I work on that implements those functions, and the functions work there. Why might the OnMove() and OnMoving() functions not be called? And how might I
    get around it?

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digdist.bbsindex.com
  • From Nightfox@VERT/DIGDIST to All on Wednesday, October 26, 2011 18:10:58
    Re: MFC: OnMoving() not being called
    By: Nightfox to All on Wed Oct 26 2011 16:54:35

    My main GUI class is derived from CDialogEx, and I've implemented OnMove() a OnMoving() in my class with the same signature as described in the documentation. However, those two functions are not being called when the G is moved.

    Of course, right after I posted that message, I found the solution. :) My dialog class didn't have WM_MOVE() and WM_MOVING() in its message map.

    MFC is frustrating sometimes.. One reason is that it's inconsistent - Some message handlers require a message map entry, but others don't because they're implemented by overridden class methods.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digdist.bbsindex.com
  • From Tracker1@VERT/TRN to Nightfox on Thursday, November 17, 2011 21:21:50
    On 10/26/2011 6:10 PM, Nightfox wrote:

    Of course, right after I posted that message, I found the solution. :) My dialog class didn't have WM_MOVE() and WM_MOVING() in its message map.

    MFC is frustrating sometimes.. One reason is that it's inconsistent - Some message handlers require a message map entry, but others don't because they're
    implemented by overridden class methods.

    .Net (C# or VB) and winforms is easier.. ;)

    --
    Michael J. Ryan - http://tracker1.info/

    ---
    þ Synchronet þ Roughneck BBS - telnet://roughneckbbs.com - www.roughneckbbs.com
  • From Nightfox@VERT/DIGDIST to Tracker1 on Thursday, December 15, 2011 17:52:41
    On 10/26/2011 6:10 PM, Nightfox wrote:

    Of course, right after I posted that message, I found the solution. :) My dialog class didn't have WM_MOVE() and WM_MOVING() in its message map.

    MFC is frustrating sometimes.. One reason is that it's inconsistent - Some message handlers require a message map entry, but others don't because they're implemented by overridden class methods.

    .Net (C# or VB) and winforms is easier.. ;)

    Ah, but be that as it may, there are sometimes legacy applications that still need to be maintained, and it's not always convenient to rewrite them in .NET at a given time.. ;)

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digdist.bbsindex.com