Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Application just terminates on pressing Enter

Application just terminates on pressing Enter

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    a3gupta
    wrote on last edited by
    #1

    Hello, I am getting the strangest error. I have a VC++ Dialog-based application using VC++ 6.0. At one point in my application, if I press "Enter" the application just quits. If I press anything else of click the button to go on a next screen etc. .. it works fine. IF I press the "X" on top corner to quit, it asks me if I want to quit and quits normally. But if I press Enter on that screen it just suddenly terminates, completely blimps out!! I doesn't happen if I press space. If I press Esc then a messagebox comes and and asks me if I want to quit the application. ... I do have OnOk() function over ridden. and when I press Enter, the application quits before it even enters the over ridden OnOk() function. I have changed the declaration of OnOk in my .h file in many different ways. I do not have an event handler explicitly declared for OnOk function. It doesn't happen if the focus is on one of the buttons. Then that buttons click event gets executed. It doesn't happen if I set one of the buttons to be Default Ok .. then by pressing Enter that button gets executed. But if I have focus on any text or combo box .. and press Enter .. it just terminates the application with no warning or message. Please help. I will really appreciate any insight into this. Thanks Sincerely, anjum Gupta.

    M 1 Reply Last reply
    0
    • A a3gupta

      Hello, I am getting the strangest error. I have a VC++ Dialog-based application using VC++ 6.0. At one point in my application, if I press "Enter" the application just quits. If I press anything else of click the button to go on a next screen etc. .. it works fine. IF I press the "X" on top corner to quit, it asks me if I want to quit and quits normally. But if I press Enter on that screen it just suddenly terminates, completely blimps out!! I doesn't happen if I press space. If I press Esc then a messagebox comes and and asks me if I want to quit the application. ... I do have OnOk() function over ridden. and when I press Enter, the application quits before it even enters the over ridden OnOk() function. I have changed the declaration of OnOk in my .h file in many different ways. I do not have an event handler explicitly declared for OnOk function. It doesn't happen if the focus is on one of the buttons. Then that buttons click event gets executed. It doesn't happen if I set one of the buttons to be Default Ok .. then by pressing Enter that button gets executed. But if I have focus on any text or combo box .. and press Enter .. it just terminates the application with no warning or message. Please help. I will really appreciate any insight into this. Thanks Sincerely, anjum Gupta.

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      You should override OnOK() not OnOk() (capitalization matters). This is covered in the VC forum FAQ. --Mike-- Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer My really out-of-date homepage Sonork-100.19012 Acid_Helm

      A 1 Reply Last reply
      0
      • M Michael Dunn

        You should override OnOK() not OnOk() (capitalization matters). This is covered in the VC forum FAQ. --Mike-- Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer My really out-of-date homepage Sonork-100.19012 Acid_Helm

        A Offline
        A Offline
        a3gupta
        wrote on last edited by
        #3

        Hey Mike, I feel a little ebarassed .. but more glad that you could really help me with this problem. I looked into it .. but completely missed the capitalization of "K" !!! Thanks once again! Anjum.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups