Question I have one form which creates a number of copyof another, and i'm getting this error

Joined
Jun 7, 2011
Messages
5
Programming Experience
5-10
I keep getting this error, The requested resource is in use. (Exception from HRESULT: 0x800700AA)
how do i fix this



I'm using this script to copy the form
Public Sub CopyFORM(ByVal sTARTLOOP As Integer, ByVal ENDLOOP As Integer, ByVal textinputbox As String)

Dim f As Translate
For count As Integer = sTARTLOOP To ENDLOOP
f = New Megahit
f.Name = "English to French - Version" & count
f.Text = f.Name
f.TextBox1.Text = textinputbox
Call f.Start_Click_1()

f.Hide()

Next


End Sub


The resource shouldn't be in use as a copy is being used....
 
The requested resource is in use. (Exception from HRESULT: 0x800700AA)
An unmanged resource of some kind is attempted used, but this resource is already in use/busy.
 
Its your memory getting overloaded with forms.
Try f.Close()
f.Dispose()

than f.Hide(),

because f.Hide() keeps the form inside the memory.

or you can restrict the number of forms being created.
 
I want the created forms to stay active in the background, hence why I have used form.hide() rather than show

Is there a way I can have many of these created forms running in the background without these errors occurring.
(I really don't understand why these errors are showing up)

1. My computer has several cores etc (So shouldn't be filling up memory)
2. A new copy of the original form is created (in which case, data should not be in use by multiple forms past the copying stage)
 
Back
Top