Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.4 KiB

  1. VERSION 5.00
  2. Begin VB.Form Form1
  3. Caption = "Form1"
  4. ClientHeight = 3195
  5. ClientLeft = 60
  6. ClientTop = 345
  7. ClientWidth = 4680
  8. LinkTopic = "Form1"
  9. ScaleHeight = 3195
  10. ScaleWidth = 4680
  11. StartUpPosition = 3 'Windows Default
  12. End
  13. Attribute VB_Name = "Form1"
  14. Attribute VB_GlobalNameSpace = False
  15. Attribute VB_Creatable = False
  16. Attribute VB_PredeclaredId = True
  17. Attribute VB_Exposed = False
  18. Private Sub Form_Load()
  19. Dim Class As SWbemObject
  20. Set Class = GetObject("winmgmts:").Get
  21. Class.Path_.Class = "Fred"
  22. 'Note that by commenting out the next line
  23. 'the array assignment below works! This is due to the IDispatch code
  24. 'for SWbemProperty handling the array assignment logic correctly, but
  25. 'the vtable code relies on VB interpreting the array assignment as a Put -
  26. 'however it interprets it as "Retrive the VARIANT corresponding to
  27. 'Property.Value, assign that to a temporary VB variable, and set the
  28. 'temporary variable.
  29. Dim Property As SWbemProperty
  30. Set Property = Class.Properties_.Add("p1", wbemCimtypeUint32, True)
  31. Property.Value = Array(1, 45, 23)
  32. 'Debug.Print Property(0)
  33. 'Debug.Print Property(1)
  34. Property.Value(2) = 3
  35. 'Debug.Print Property(2)
  36. End Sub