How to check if an object is valid
Hi
How do I check if an object returned by some function call is valid?
In C++/MFC I'd use a Macro (such as FAILED or SUCCEDED), so whats the magic word in VB6
Private Sub MyTreeView_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim currentNode As Node
'If a node is hit then OK, however if HitTest failed I get
'node = nothing
Set currentNode = TreeViewRics.HitTest(x, y)
If currentNode = Nothing Then 'This doesn't work
Exit Sub
End If
If Button = vbRightButton Then
PopupMenu mnuTest, vbPopupMenuLeftAlign
End If
Set currentNode = Nothing
End Sub