BUG: WBEM Namespace Picker Control Does Not Connect to WMI in Visual Basic IDE (244604)



The information in this article applies to:

  • Microsoft Windows Management Instrumentation 1.1
  • Microsoft Visual Basic Learning Edition for Windows 6.0
  • Microsoft Visual Basic Professional Edition for Windows 6.0

This article was previously published under Q244604

SYMPTOMS

When you use the WBEM Namespace Picker Control (WBEMNSPicker.ocx) on a Microsoft Visual Basic form in the Visual Basic IDE debug environment, pressing the Connect button fails to connect to Windows Management Instrumentation (WMI).

CAUSE

The current implementation of the WBEM Namespace Picker Control is incompatible with the Visual Basic IDE.

RESOLUTION

Although you cannot use the WBEM Namespace Picker Control when running in the Visual Basic IDE debug environment, the control functions properly from an EXE. Generate an EXE in order to use the control on a Visual Basic form.

STATUS

Microsoft has confirmed that this is a bug in Microsoft Windows Management Instrumentation, version 1.1.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a Standard EXE project in Visual Basic.
  2. Include both the WBEM Login Control and the WBEM Namespace Picker Control ActiveX components.
  3. Add an instance of both of these components to a form.
  4. Add the following handler for the namespace picker control. In this code the login control is named Login1 and the namespace picker control is named NamespacePicker1.
    Private Sub NamespacePicker1_GetIWbemServices(ByVal lpctstrNamespace As String, pvarUpdatePointer As Variant, pvarServices As Variant, pvarSC As Variant, pvarUserCancel As Variant)
    
    Login1.GetIWbemServices lpctstrNamespace, pvarUpdatePointer, pvarServices, pvarSC, pvarUserCancel<BR/>
    End Sub
    					
  5. Run the program in the Visual Basic IDE debug environment.
  6. Click the computer icon to the right end of the namespace picker control.
  7. Click the Connect button in the Browse for Namespace dialog box. Nothing seems to happen.
To work around this problem:

  1. Generate an EXE for the preceding project.
  2. Run the EXE.
  3. Perform steps 6 - 7 in the preceding "Steps to Reproduce Behavior" section. A dialog box opens which prompts you for a username and password. This is the correct behavior.

REFERENCES

For more information, see the WMI SDK documentation in the Platform SDK.

Modification Type:MajorLast Reviewed:11/17/2003
Keywords:kbBug kbpending kbWBEM KB244604