WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE COM ADO CDO ADSI LDAP
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

OLE Handle Reassignment

 Keywords:  

Question:

When assigning an OLE handle and then re-assigning it, does WIL automatically close the object to which the variable was previously assigned or should I do that manually? I'm re-assigning handles in a script I've written using the same variable name over an over and I want to know if I'm "polluting the environment".

Answer:

When a something containing an OLE object is assigned to a variable, a "reference count" is incremented for the ole object.

When variables containing an OLE object is dropped or reused the reference count is decremented. If the reference count goes to zero, the object is automagically closed.

Something like that anyway. The answer is yes you can just re-use the variable and don't have to worry about ObjectClosing it.


Article ID:   W15581
File Created: 2003:05:13:11:29:08
Last Updated: 2003:05:13:11:29:08