|
-
Jan 23rd, 2002, 07:30 AM
#1
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|