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

Functions

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

Drop Function

 Keywords: Drop COM OLE Object 0 Zero Close Free Handle WIL Variable FileClose Binary Free ObjectClose

Question:

I am working with a COM object. Once I am finished with the object I want to close the hande and free the WIL variable. Do need to both close the object by setting it to zero and then free the variable or can I just call Drop?
objhandle = 0
Drop(objhandle)
OR just this?
Drop(objhandle)
In short does the Drop function free the COM object?

Answer:

COM Automation variants, including objects references, have their own variable type and therefore can be identified and released automagically by the 'Drop' function.

However other WIL handles ( like File and BInary handles) are stored as integer values in variables so the 'Drop' function cannot distinguish them as handles and you need to use their specific function. i.e. FileClose or BinaryFree.


Article ID:   W17893
Filename:   Drop Function.txt
File Created: 2013:06:07:08:49:30
Last Updated: 2013:06:07:08:49:30