I know there was some debate on whether you should set it to nothing or let VB take care of it.. However it is part of our company coding standards to set the object to nothing when done.
1. Do I need to check if the object exists before setting to Nothing? (more obvious in class vars).
If NOT obj Is Nothing Then Set obj = Nothing
2. Usually we dont create a new object just set it as that type or It is passed in by ref. (Private m_oTempCalls As MSXML2.DOMDocument30)
Do I still need to set to Nothing or check if not Nothing already.
Should I just make sure that any class level object gets set to nothing in the Class_terminate methods?
This is a COM++ app with VB 6 and VS C++
Thanks in advance.
New to the COM stuff..
1. Do I need to check if the object exists before setting to Nothing? (more obvious in class vars).
If NOT obj Is Nothing Then Set obj = Nothing
2. Usually we dont create a new object just set it as that type or It is passed in by ref. (Private m_oTempCalls As MSXML2.DOMDocument30)
Do I still need to set to Nothing or check if not Nothing already.
Should I just make sure that any class level object gets set to nothing in the Class_terminate methods?
This is a COM++ app with VB 6 and VS C++
Thanks in advance.
New to the COM stuff..