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#
  4. Getting unhandled exception in runtime

Getting unhandled exception in runtime

Scheduled Pinned Locked Moved C#
helpquestionvisual-studiodebugging
5 Posts 3 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.
  • B Offline
    B Offline
    beatles1692
    wrote on last edited by
    #1

    Hi I have a strange problem.In an application ,I have a login process and I'd like to show the progress of this process on a progress form using a progress bar and a label describing what is going on.Thus I put a progress form in my project and whenever this form is activated starts the login process and listens to a progress event that tells it to refresh the controls according to the progress. There's a LoginFailedException in my app that is thrown whenever the username and/or the password is incorrect.I've handled this exception by showing a message box.Every time I debug my project using VS2003 IDE and provide some incorrect information It works fine and shows me the message box but when I exceute the exe file directly ,an unhandled exception is thrown just like there is no exception handler available. What is wrong with my program? please help me.

    C 1 Reply Last reply
    0
    • B beatles1692

      Hi I have a strange problem.In an application ,I have a login process and I'd like to show the progress of this process on a progress form using a progress bar and a label describing what is going on.Thus I put a progress form in my project and whenever this form is activated starts the login process and listens to a progress event that tells it to refresh the controls according to the progress. There's a LoginFailedException in my app that is thrown whenever the username and/or the password is incorrect.I've handled this exception by showing a message box.Every time I debug my project using VS2003 IDE and provide some incorrect information It works fine and shows me the message box but when I exceute the exe file directly ,an unhandled exception is thrown just like there is no exception handler available. What is wrong with my program? please help me.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Hard to say, without seeing some code.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      B 1 Reply Last reply
      0
      • C Christian Graus

        Hard to say, without seeing some code.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        B Offline
        B Offline
        beatles1692
        wrote on last edited by
        #3

        Here it is : In my login form: private void OnOKButtonClicked() { try { this.Cursor=Cursors.WaitCursor; progressForm.Login(this.txtUsername.Text,this.txtPassword.Text) ; this.Cursor=Cursors.Default; this.Close(); } catch(LoginFailedException) { this.Cursor=Cursors.Default; MessageBox.Show("Invalid username and/or password."); } catch(Exception exp) { new ExceptionViewForm(exp).ShowDialog(); } } In my progress from: internal static void Login(string username,string password) { progressForm frm=new progressForm() ; frm.username=username; frm.password=password; frm.ShowDialog(); } protected override void OnActivated(EventArgs e) { if(! activated) { LoginForm.engine= LoginProcess.Instance.Login(this.username,this.password); } }

        C 1 Reply Last reply
        0
        • B beatles1692

          Here it is : In my login form: private void OnOKButtonClicked() { try { this.Cursor=Cursors.WaitCursor; progressForm.Login(this.txtUsername.Text,this.txtPassword.Text) ; this.Cursor=Cursors.Default; this.Close(); } catch(LoginFailedException) { this.Cursor=Cursors.Default; MessageBox.Show("Invalid username and/or password."); } catch(Exception exp) { new ExceptionViewForm(exp).ShowDialog(); } } In my progress from: internal static void Login(string username,string password) { progressForm frm=new progressForm() ; frm.username=username; frm.password=password; frm.ShowDialog(); } protected override void OnActivated(EventArgs e) { if(! activated) { LoginForm.engine= LoginProcess.Instance.Login(this.username,this.password); } }

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          And what is the exception when it is run standalone? When you run it stand alone is it a debug or release build?


          Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... * Reading: Developer Day 5 Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

          B 1 Reply Last reply
          0
          • C Colin Angus Mackay

            And what is the exception when it is run standalone? When you run it stand alone is it a debug or release build?


            Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... * Reading: Developer Day 5 Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

            B Offline
            B Offline
            beatles1692
            wrote on last edited by
            #5

            Hi Exception is LoginFailedException and the stand alone program has been built using debug configuration.

            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