Load Unload problem 
Author Message
 Load Unload problem

hi folks,
i've got a little problem. i unload a form with 'Unload Me' and later
i try to load it with 'Load frmForm', so that the Load procedure is called
up again. but i get the error message "Object has been unloaded".
thanks for any help


Sun, 11 Dec 2005 00:15:42 GMT  
 Load Unload problem

Quote:

>hi folks,
>i've got a little problem. i unload a form with 'Unload Me' and later
>i try to load it with 'Load frmForm', so that the Load procedure is called
>up again. but i get the error message "Object has been unloaded".
>thanks for any help

This can be caused by a multitude or reasons...
One thing you might try is putting the following line in the UnLoad Event of frmForm..
(that is if frmForm is the one you are loading/unloading)

Set frmForm = Nothing

See if that helps...
Have a good day...

Don



Sun, 11 Dec 2005 00:26:23 GMT  
 Load Unload problem
:( it didn't work. but thanks anyway

Quote:

> This can be caused by a multitude or reasons...
> One thing you might try is putting the following line in the UnLoad Event
of frmForm..
> (that is if frmForm is the one you are loading/unloading)

> Set frmForm = Nothing

> See if that helps...
> Have a good day...

> Don



Sun, 11 Dec 2005 00:30:27 GMT  
 Load Unload problem
On Tue, 24 Jun 2003 16:15:42 GMT, "Benjamin Maurer"

Quote:

>hi folks,
>i've got a little problem. i unload a form with 'Unload Me' and later
>i try to load it with 'Load frmForm', so that the Load procedure is called
>up again. but i get the error message "Object has been unloaded".
>thanks for any help

What language - eg: VB5 VB6 VB.Nyet - VB in something like Word

?

What platform - Win 9x  2k ?



Sun, 11 Dec 2005 01:09:45 GMT  
 Load Unload problem
Ok, some more details:
i prog Visual Basic 6 with service pack 5 under win 2k. my application
starts
with a form which i use as  option window. after that, it loads an other
form
which draws some graphics using directx7 direct draw in the fullscreen mode.
after pushing Esc, the form should beUnloaded and the config window should
be shown again. but i get the error "object has been unloaded"

ps: sorry for my bad english, its not my native language



Sun, 11 Dec 2005 01:15:00 GMT  
 Load Unload problem
On Tue, 24 Jun 2003 17:15:00 GMT, "Benjamin Maurer"

Quote:

>Ok, some more details:
>i prog visual basic 6 with service pack 5 under win 2k. my application
>starts
>with a form which i use as  option window. after that, it loads an other
>form
>which draws some graphics using directx7 direct draw in the fullscreen mode.
>after pushing Esc, the form should beUnloaded and the config window should
>be shown again. but i get the error "object has been unloaded"

>ps: sorry for my bad english, its not my native language

Ok, the probability is 95% that this error is _not_ from VB

Read the documentation on the DirectX thing

Chances are that it requires some _explicit_ call to kill itself



Sun, 11 Dec 2005 02:20:52 GMT  
 Load Unload problem
Quote:
> Ok, the probability is 95% that this error is _not_ from VB

> Read the documentation on the DirectX thing

it has nothing to do with directx, because i kill all direct x objects
before
i unload the form. at first, i killed the objects and after that i closed
the
proggy with 'end'. but now i wanted to load the config screen again so i
made the change. so it has nothing to do with dx

Quote:
> Chances are that it requires some _explicit_ call to kill itself

i dont know what that means : /


Sun, 11 Dec 2005 02:43:40 GMT  
 Load Unload problem

Quote:

> > Ok, the probability is 95% that this error is _not_ from VB

> > Read the documentation on the DirectX thing

> it has nothing to do with directx, because i kill all direct x objects
> before
> i unload the form. at first, i killed the objects and after that i closed
> the
> proggy with 'end'. but now i wanted to load the config screen again so i
> made the change. so it has nothing to do with dx

I don't see how that <necessarily> follows...possible to have missed
something?

'End' terminates the process whether everything is gone or not and
leaves it up to the OS to (hopefully) clean up the mess...not a
good/recommended technique.  So I don't see that you can reject the
suggested as a possibility...



Sun, 11 Dec 2005 02:50:58 GMT  
 Load Unload problem

Quote:

>> Ok, the probability is 95% that this error is _not_ from VB

>> Read the documentation on the DirectX thing

>it has nothing to do with directx, because i kill all direct x objects
>before
>i unload the form. at first, i killed the objects and after that i closed
>the
>proggy with 'end'. but now i wanted to load the config screen again so i

Ouch!!!!! Never use 'End' unless absolutely needed. (vary far and vary few between)
Use the Unload statement..
ie: Unload Me

Quote:
>made the change. so it has nothing to do with dx

>> Chances are that it requires some _explicit_ call to kill itself
>i dont know what that means : /

Have a good day...

Don



Sun, 11 Dec 2005 02:53:47 GMT  
 Load Unload problem
: / thats not the problem! i have used the end statement BEFORE that what
i have a problem with. and for everyone whos shocked that i use end: i clean
up
everything before! (kill all objects with set obj = Nothing)

but the point is, that my real problem is that i unload a form and i get an
error if i load it afterwards again. (Unload Me, afterwards in another form
Load frmForm) Error "ojbect is unloaded"



Quote:
> On Tue, 24 Jun 2003 18:43:40 GMT, "Benjamin Maurer"

> >> Ok, the probability is 95% that this error is _not_ from VB

> >> Read the documentation on the DirectX thing

> >it has nothing to do with directx, because i kill all direct x objects
> >before
> >i unload the form. at first, i killed the objects and after that i closed
> >the
> >proggy with 'end'. but now i wanted to load the config screen again so i

> Ouch!!!!! Never use 'End' unless absolutely needed. (vary far and vary few
between)
> Use the Unload statement..
> ie: Unload Me

> >made the change. so it has nothing to do with dx

> >> Chances are that it requires some _explicit_ call to kill itself
> >i dont know what that means : /

> Have a good day...

> Don



Sun, 11 Dec 2005 03:37:59 GMT  
 Load Unload problem
On Tue, 24 Jun 2003 18:43:40 GMT, "Benjamin Maurer"

You said :-

Quote:
>after that i closed the proggy with 'end'

Do you remember Joyce Grenfell ?

'Just don't do that - don't do it'

Using 'End' is like picking your nose in public

- it is disgusting behaviour  (I did it once, but I learnt)



Sun, 11 Dec 2005 03:49:46 GMT  
 Load Unload problem
On Tue, 24 Jun 2003 19:37:59 GMT, "Benjamin Maurer"

Quote:

>: / thats not the problem! i have used the end statement BEFORE that what
>i have a problem with. and for everyone whos shocked that i use end: i clean
>up
>everything before! (kill all objects with set obj = Nothing)

>but the point is, that my real problem is that i unload a form and i get an
>error if i load it afterwards again. (Unload Me, afterwards in another form
>Load frmForm) Error "ojbect is unloaded"

And are you watching the Form Terminate Event ?

Strip your App down to the bare minimum (pls backup first)
- and watch the Initialize and Terminate Events until ... you trap the
problem



Sun, 11 Dec 2005 04:11:45 GMT  
 Load Unload problem
No, the "End" isn't the problem now, and nobody said it is--but simply
pointed out it's not good practice...many who post here don't recognize
the issues and it's impossible to tell one who does from one who
doesn't...

And, apparently you didn't clean up <everything>....if you're not
willing to accept you may have made a mistake or overlooked something,
and accept advice/suggestions in the spirit there offered, there's no
use in posting to a ng...

Quote:

> : / thats not the problem! i have used the end statement BEFORE that what
> i have a problem with. and for everyone whos shocked that i use end: i clean
> up
> everything before! (kill all objects with set obj = Nothing)

> but the point is, that my real problem is that i unload a form and i get an
> error if i load it afterwards again. (Unload Me, afterwards in another form
> Load frmForm) Error "ojbect is unloaded"



Sun, 11 Dec 2005 04:10:35 GMT  
 Load Unload problem



Quote:
> hi folks,
> i've got a little problem. i unload a form with 'Unload Me' and later
> i try to load it with 'Load frmForm', so that the Load procedure is called
> up again. but i get the error message "Object has been unloaded".
> thanks for any help

I had this error once, when I called unload me within the form_load event
after I had numerous subs called.

So, Benjamin, is the load-event fully completed when you call unload me?

Gunter



Sun, 11 Dec 2005 04:10:30 GMT  
 Load Unload problem
yes it is, its not the unload that makes trouble.when i click on
debugg, the line "Load frmForm" is marked yellow. so the unloading
was succsessful (i have checked if the load procedure is finished) but
when i want to load again i get an error



Quote:



> > hi folks,
> > i've got a little problem. i unload a form with 'Unload Me' and later
> > i try to load it with 'Load frmForm', so that the Load procedure is
called
> > up again. but i get the error message "Object has been unloaded".
> > thanks for any help

> I had this error once, when I called unload me within the form_load event
> after I had numerous subs called.

> So, Benjamin, is the load-event fully completed when you call unload me?

> Gunter



Sun, 11 Dec 2005 18:41:50 GMT  
 
 [ 16 post ]  Go to page: [1] [2]

 Relevant Pages 

1. VBDOS - proj FORM load/unload memory problem

2. Curious Memory problem loading/unloading Forms

3. Problem with Form Load and Unload

4. form loading and unloading problem

5. VBDOS PROF - FORM LOAD/UNLOAD MEMORY PROBLEM

6. Problem with Unloading Modal form (during its load)

7. Problem with dll loading/unloading

8. HELP: Show/Hide vs Load/Unload, KeyPress vs Change, Load(Param$)

9. Problem getting program to end after unloading the form (Unload Me)

10. unloading/loading subforms

11. UserForms, Load and Unload

12. how to load and unload an com addin using VBA or VB

 

 
Powered by phpBB® Forum Software