MFC - Keyboard - Programmer

This is a discussion on MFC - Keyboard - Programmer ; Hi, i've got a little problem. I will probably learn mfc a bit better some day, but as for know, i don't have time for that. I've made a little program to communicate with my diploma work via RS232. I ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: MFC - Keyboard

  1. MFC - Keyboard

    Hi,

    i've got a little problem. I will probably learn mfc a bit better some
    day, but
    as for know, i don't have time for that. I've made a little program to
    communicate
    with my diploma work via RS232. I have a window class CProgramDlg
    derived
    from CDialog, and the problem is that, even though I haven't overloaded
    any
    of the OnKeyDown / OnKeyUp functions, the window closes when i type
    ESC or ENTER. How come ? how can I change it ? I would like this window
    not to react on any users interaction, so that it would dissapear when
    my timer
    finishes counting.

    thx in advance,

    --
    Poison64
    poison64(aT)op.pl
    http://www.poison64.prv.pl



  2. Re: MFC - Keyboard

    On Sat, 24 Apr 2004 17:49:50 +0200, "Poison64" wrote:

    >Hi,
    >
    > i've got a little problem. I will probably learn mfc a bit better some
    >day, but
    > as for know, i don't have time for that. I've made a little program to
    >communicate
    > with my diploma work via RS232. I have a window class CProgramDlg
    >derived
    > from CDialog, and the problem is that, even though I haven't overloaded
    >any
    > of the OnKeyDown / OnKeyUp functions, the window closes when i type
    > ESC or ENTER. How come ? how can I change it ? I would like this window
    > not to react on any users interaction, so that it would dissapear when
    >my timer
    > finishes counting.


    Use class wizard to get your OnCancel function, and remove the
    "CDialog::OnCancel" line. That will stop the box disappearing.

    Quandon


  3. Re: MFC - Keyboard

    you could override the OnOK and OnCancel functions and not call the base
    class CDialog::OnOK and CDialog::OnCancel calls which close the window:

    CProgramDlg::OnOK()
    {
    // do nothing
    }

    CProgramDlg::OnCancel()
    {
    // do nothing
    }




    "Poison64" wrote in message
    news:c6e2av$4dp$1@news.onet.pl...
    Hi,

    i've got a little problem. I will probably learn mfc a bit better some
    day, but
    as for know, i don't have time for that. I've made a little program to
    communicate
    with my diploma work via RS232. I have a window class CProgramDlg
    derived
    from CDialog, and the problem is that, even though I haven't overloaded
    any
    of the OnKeyDown / OnKeyUp functions, the window closes when i type
    ESC or ENTER. How come ? how can I change it ? I would like this window
    not to react on any users interaction, so that it would dissapear when
    my timer
    finishes counting.

    thx in advance,

    --
    Poison64
    poison64(aT)op.pl
    http://www.poison64.prv.pl




  4. Re: MFC - Keyboard

    At dialog-based application, if you don't want to close window bye ENTER or
    ESC. devired your own OnOK and OnCancel function, do nothing, it will be
    done.
    "Poison64" bl news:c6e2av$4dp$1@news.onet.pl g
    ....
    > Hi,
    >
    > i've got a little problem. I will probably learn mfc a bit better some
    > day, but
    > as for know, i don't have time for that. I've made a little program to
    > communicate
    > with my diploma work via RS232. I have a window class CProgramDlg
    > derived
    > from CDialog, and the problem is that, even though I haven't

    overloaded
    > any
    > of the OnKeyDown / OnKeyUp functions, the window closes when i type
    > ESC or ENTER. How come ? how can I change it ? I would like this

    window
    > not to react on any users interaction, so that it would dissapear when
    > my timer
    > finishes counting.
    >
    > thx in advance,
    >
    > --
    > Poison64
    > poison64(aT)op.pl
    > http://www.poison64.prv.pl
    >
    >




+ Reply to Thread