Microsoft KB Archive/250314
Article ID: 250314
Article Last Modified on 3/20/2004
- Microsoft Visual Basic 6.0 Professional Edition
This article was previously published under Q250314
Programmatically expanding the Static Node at run time may cause the following error message to be displayed:
If the Static Node has not been expanded by the user by either double-clicking the Static Node or by clicking the plus sign next to the Static Node, the ExpandInNameSpace method displays the error message shown in the "Symptoms" section.
The Static Node must be expanded manually by the user.
The following code demonstrates this error. Using the Views_AddTopMenuItems code below, the call to open the Static Node causes the error message:
Private Sub Views_AddTopMenuItems(ByVal View As SnapInLib.View, _ ByVal Selection As SnapInLib.MMCClipboard, _ ByVal ContextMenu As SnapInLib.ContextMenu, _ InsertionAllowed As Boolean) With Selection.ScopeItems(1) 'Check to see if the current ScopeNode has been 'expanded and if only a sigular ScopeNode has been 'selected. If .ScopeNode.ExpandedOnce = False And Selection.SelectionType = siSingleScopeItem Then 'Expand the currently selected ScopeNode .ScopeNode.ExpandInNameSpace 'Add Context Menu. ContextMenu.AddMenu mnuMain End If End With End Sub
This error is rare because the Static Node object is normally fully loaded before other methods attempt to expand the node.
Keywords: kbprb kbsnapin kbdswmanage2003swept KB250314