Error Running Debug

  • Thread starter Thread starter poppybush
  • Start date Start date
P

poppybush

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.
 
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.
Me.Hide()
Dim Form1 As New Form1
Form1.Show()

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

Cor
 
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:
http://www.mztools.com
 
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.
 
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:
http://www.mztools.com
 
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!
 
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:
http://www.mztools.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top