What does "an object is released" mean?

Posted on 1999-06-30
Medium Priority
Last Modified: 2010-05-02
In MSDN Online Library

Unload event occurs when an object is released
Queryunload event occurs before a form is unloaded.
Destroy event occurs when an object is released.

What does "an object is released" mean?

Actually I'm naive to VB.

Are there clear cut explanations on VB Events?

Thank you.
Question by:iamjhkang

Accepted Solution

davepcam1 earned 90 total points
ID: 1521240
When u create an instance to a object (e.g set nodex = treeview1.nodes) you literally are creating like a gateway to this object, nodex is the gateway to treeview1.nodes

when you release it (e.g set nodex = nothing) it flushes system resources, it would be like closing the gateway to treeview1.nodes

when you set it to nothing its unloaded, like it says, its nothing

Good luck

Expert Comment

ID: 1521241
The events are not bad desribed in the vb help. QueryUnload is an event, that just happens before Unload: You can use it, if you want for example pervent a user from closing a window without saving his work, as you know it from most texteditors.
QueryUnload has a parameter - i think CancelUnload, that you must set to true, if you want the unload process to be stopped.

It is worth the work, to test out some events, to see when and and after what tehy appera - I used to take labels on an form, on which I changed the labels according to differenet events (HIDE, SHOW, LOAD, UNLOAD, QUERYUNLOASD etc.) so I learned their meanings.


Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

588 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question