Error Running Debug

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • poppybush@gmail.com

    #1

    Error Running Debug

    I'm just added a new form to my application for entering information to
    a database. To do this I did:


    Me.Hide()
    Dim Form1 As New Form1
    Form1.Show()

    When I run debugger, test, and end the software (By clicking the X on
    the top right corner) the program ends. Well, when I go to debug mode I
    get an error stating that:

    "Could not copy temporary files to the output directory."

    "The file 'Project.exe' cannot be copied to the run directory. The
    process cannot access the file because it is being used by another
    process."

    The only way I can get back to testing the software is to open Task
    Manager and end the process of Project.exe. The only thing I can think
    of is that when the user is finished inputting data into Form1 they
    press the "Hide Me" button to hide the form. It seems that if this form
    is still open and the .exe can't end.

    I am somewhat new to windows application development so I really don't
    know what to think. Thanks in advance.

  • Cor Ligthert [MVP]

    #2
    Re: Error Running Debug

    Hi,

    I don't know why you do this, however if it is real as you show and you do
    this from form1 than it is not possible that you eat your complete memory
    and than everything becomes unpredictable.
    [color=blue]
    >
    > Me.Hide()
    > Dim Form1 As New Form1
    > Form1.Show()
    >[/color]

    Can you show it a little bit more exact, by instance in what event you are
    using this.

    Cor


    Comment

    • Carlos J. Quintero [VB MVP]

      #3
      Re: Error Running Debug

      Yes, you program is not ending, it just happens that the forms are not
      visible. Normally you have:

      - Non modal forms, shown using form.Show, likely in a MDI form container.
      - Modal forms, using form.ShowDialog .

      Normally you don´t have "Hide me" buttons, you have "Close" or "OK" +
      "Cancel" window dialogs that close the window (not just hiding it).

      So, assuming that your app has a form and you want to show another form to
      enter data, try with a modal form using:

      Dim frm As New Fomr2()
      If frm.ShowDialog( ...) = DialogResult.OK
      ' Process data
      End If
      frm.Dispose()

      --

      Best regards,

      Carlos J. Quintero

      MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
      You can code, design and document much faster.
      Free resources for add-in developers:
      MZ-Tools has a single goal: To make your everyday programming life easier. As an add-in to several Integrated Development Environment (IDEs) from Microsoft, MZ-Tools adds new menus and toolbars to them that provide many new productivity features.


      <poppybush@gmai l.com> escribió en el mensaje
      news:1130367741 .980479.148700@ g43g2000cwa.goo glegroups.com.. .[color=blue]
      > I'm just added a new form to my application for entering information to
      > a database. To do this I did:
      >
      >
      > Me.Hide()
      > Dim Form1 As New Form1
      > Form1.Show()
      >
      > When I run debugger, test, and end the software (By clicking the X on
      > the top right corner) the program ends. Well, when I go to debug mode I
      > get an error stating that:
      >
      > "Could not copy temporary files to the output directory."
      >
      > "The file 'Project.exe' cannot be copied to the run directory. The
      > process cannot access the file because it is being used by another
      > process."
      >
      > The only way I can get back to testing the software is to open Task
      > Manager and end the process of Project.exe. The only thing I can think
      > of is that when the user is finished inputting data into Form1 they
      > press the "Hide Me" button to hide the form. It seems that if this form
      > is still open and the .exe can't end.
      >
      > I am somewhat new to windows application development so I really don't
      > know what to think. Thanks in advance.
      >[/color]


      Comment

      • Paul Bush

        #4
        Re: Error Running Debug

        Cor,

        If you would would've read my original post you would have seen that I
        am NEW to windows application development. This more than explains the
        problem that I am having. It is also very hard to understand what you
        are trying to say/ask me. I thought MVP's were supposed to help people
        in times of need. Since when did MVP's start taking an elitist
        programmer attitude with their condescending remarks?

        Carlos,

        Thank you very much for your feedback. I will look into this and let
        you know if it helped me out.

        Comment

        • Carlos J. Quintero [VB MVP]

          #5
          Re: Error Running Debug

          Ok, let us know if the problem is solved or not and please consider that
          neither Cor nor I do speak native English, so our language sometimes is far
          from perfect. I am sure that Cor did not intend to show elitist attitudes.

          --

          Best regards,

          Carlos J. Quintero

          MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
          You can code, design and document much faster.
          Free resources for add-in developers:
          MZ-Tools has a single goal: To make your everyday programming life easier. As an add-in to several Integrated Development Environment (IDEs) from Microsoft, MZ-Tools adds new menus and toolbars to them that provide many new productivity features.


          "Paul Bush" <poppybush@gmai l.com> escribió en el mensaje
          news:1130425057 .405579.111320@ g43g2000cwa.goo glegroups.com.. .[color=blue]
          > Cor,
          >
          > If you would would've read my original post you would have seen that I
          > am NEW to windows application development. This more than explains the
          > problem that I am having. It is also very hard to understand what you
          > are trying to say/ask me. I thought MVP's were supposed to help people
          > in times of need. Since when did MVP's start taking an elitist
          > programmer attitude with their condescending remarks?
          >
          > Carlos,
          >
          > Thank you very much for your feedback. I will look into this and let
          > you know if it helped me out.
          >[/color]


          Comment

          • Paul Bush

            #6
            Re: Error Running Debug

            My apologies then.

            Sorry Cor.

            Comment

            • Paul Bush

              #7
              Re: Error Running Debug

              Carlos,

              Thanks for your input. After reading some documentation online I think
              I have figured it out.

              To show the data entry form I have used:

              Dim frmLicenseInfo As New LicenseInfo
              frmLicenseInfo. ShowDialog()


              And to "hide" this form I have used:

              Me.DialogResult = DialogResult.OK

              Everything works fine and there is no Project.exe left in Task Manager
              when I end the program. Thanks again for your help Carlos!

              Comment

              • Carlos J. Quintero [VB MVP]

                #8
                Re: Error Running Debug

                Yes, "closing" and "hiding" windows are different things. The former
                destroyes the window and its resources, the latter only makes the window
                invisible but it is still there. I am glad that the problem is solved.

                --

                Best regards,

                Carlos J. Quintero

                MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
                You can code, design and document much faster.
                Free resources for add-in developers:
                MZ-Tools has a single goal: To make your everyday programming life easier. As an add-in to several Integrated Development Environment (IDEs) from Microsoft, MZ-Tools adds new menus and toolbars to them that provide many new productivity features.


                "Paul Bush" <poppybush@gmai l.com> escribió en el mensaje
                news:1130426098 .054894.188990@ f14g2000cwb.goo glegroups.com.. .[color=blue]
                > Carlos,
                >
                > Thanks for your input. After reading some documentation online I think
                > I have figured it out.
                >
                > To show the data entry form I have used:
                >
                > Dim frmLicenseInfo As New LicenseInfo
                > frmLicenseInfo. ShowDialog()
                >
                >
                > And to "hide" this form I have used:
                >
                > Me.DialogResult = DialogResult.OK
                >
                > Everything works fine and there is no Project.exe left in Task Manager
                > when I end the program. Thanks again for your help Carlos!
                >[/color]


                Comment

                Working...