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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CDialog::OnCancel or postmessage(wm_cancel)

CDialog::OnCancel or postmessage(wm_cancel)

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 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.
  • V Offline
    V Offline
    valerie99
    wrote on last edited by
    #1

    hi, all I kinda fixed the issue but still not sure what's wrong with the previous method. it was having access violation at this point: void CSurchrgDlg::Exit() { if( !m_bCanceled ) { ..... } CDialog::OnCancel(); } now I used "PostMessage( cDlg->GetSafeHwnd(), WM_QUIT, 0, 0 );" replaced the exit funtion at the end of RUN. seems to work. OR I used PostMessage(WM_QUIT); to replace CDialog::OnCancel(); would work, too. could someone tell me what's wrong with the calling the CDialog::OnCancel();? Thank you for your time!

    E 1 Reply Last reply
    0
    • V valerie99

      hi, all I kinda fixed the issue but still not sure what's wrong with the previous method. it was having access violation at this point: void CSurchrgDlg::Exit() { if( !m_bCanceled ) { ..... } CDialog::OnCancel(); } now I used "PostMessage( cDlg->GetSafeHwnd(), WM_QUIT, 0, 0 );" replaced the exit funtion at the end of RUN. seems to work. OR I used PostMessage(WM_QUIT); to replace CDialog::OnCancel(); would work, too. could someone tell me what's wrong with the calling the CDialog::OnCancel();? Thank you for your time!

      E Offline
      E Offline
      enjoycrack
      wrote on last edited by
      #2

      Do u mean that no thing happens when calling OnCancle() method? if so, try to overide this ... this is just a guess << >>

      V 1 Reply Last reply
      0
      • E enjoycrack

        Do u mean that no thing happens when calling OnCancle() method? if so, try to overide this ... this is just a guess << >>

        V Offline
        V Offline
        valerie99
        wrote on last edited by
        #3

        thanks for your reply. what happened was everything goes well in debug, but it crashes when it called onCancle() in release mode with access violation. I couldn't figure out why it that, by the way, is there a outline for when to use onCancle and when for postmessage()? and for the UNICODE, what is sign for UNICODE inside of a function? thanks again!

        E 1 Reply Last reply
        0
        • V valerie99

          thanks for your reply. what happened was everything goes well in debug, but it crashes when it called onCancle() in release mode with access violation. I couldn't figure out why it that, by the way, is there a outline for when to use onCancle and when for postmessage()? and for the UNICODE, what is sign for UNICODE inside of a function? thanks again!

          E Offline
          E Offline
          enjoycrack
          wrote on last edited by
          #4

          valerie99 wrote: everything goes well in debug, but it crashes when it called onCancle() in release mode it's out of my control.... :( let me know also if u overcome this << >>

          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