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. Password Dialog Box

Password Dialog Box

Scheduled Pinned Locked Moved C / C++ / MFC
help
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
    anjita
    wrote on last edited by
    #1

    I want to give password protection to one of my screens. I am calling this do while loop in the initinstance of that screen the problem is now if i press cancel button then the password dialog box should go but its not going and if its going then it opens my screen. do { if(password.DoModal()==IDOK) { if(password.m_strPassword !=File.getKeyValue("PASSWORD","password")) AfxMessageBox("Invalid Password "); } }while(password.m_strPassword !=File.getKeyValue("PASSWORD","password")); Please Help me out

    N 1 Reply Last reply
    0
    • A anjita

      I want to give password protection to one of my screens. I am calling this do while loop in the initinstance of that screen the problem is now if i press cancel button then the password dialog box should go but its not going and if its going then it opens my screen. do { if(password.DoModal()==IDOK) { if(password.m_strPassword !=File.getKeyValue("PASSWORD","password")) AfxMessageBox("Invalid Password "); } }while(password.m_strPassword !=File.getKeyValue("PASSWORD","password")); Please Help me out

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      Try this while(1) { if(password.DoModal()==IDOK) { if(password.m_strPassword !=File.getKeyValue("PASSWORD","password")) { AfxMessageBox("Invalid Password "); } else { break; } } else { return FALSE; } }

      A 1 Reply Last reply
      0
      • N Naveen

        Try this while(1) { if(password.DoModal()==IDOK) { if(password.m_strPassword !=File.getKeyValue("PASSWORD","password")) { AfxMessageBox("Invalid Password "); } else { break; } } else { return FALSE; } }

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

        Even this is not working On preesing the cancel the screen is displayed

        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