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.

54 lines
1.8 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. Dim WithEvents sink As SWbemSink
  19. Attribute sink.VB_VarHelpID = -1
  20. Private Sub Form_Load()
  21. Set sink = CreateObject("WbemScripting.SWbemSink")
  22. Dim x As SWbemObject
  23. Dim ns As SWbemServices
  24. Dim ns2 As SWbemServices
  25. Set ns = GetObject("winmgmts:root\default")
  26. Set ns2 = GetObject("winmgmts:root\cimv2")
  27. Set x = ns.Get("freddy")
  28. Dim y As SWbemObject
  29. Set y = x.SpawnInstance_
  30. y.foo = 33
  31. ns.PutAsync sink, y
  32. y.foo = 35
  33. ns2.PutAsync sink, y
  34. End Sub
  35. Private Sub sink_OnCompleted(ByVal iHResult As WbemScripting.WbemErrorEnum, ByVal objWbemErrorObject As WbemScripting.ISWbemObject, ByVal objWbemAsyncContext As WbemScripting.ISWbemNamedValueSet)
  36. Debug.Print "Done"
  37. End Sub
  38. Private Sub sink_OnObjectPut(ByVal objWbemObjectPath As WbemScripting.ISWbemObjectPath, ByVal objWbemAsyncContext As WbemScripting.ISWbemNamedValueSet)
  39. Debug.Print objWbemObjectPath.Path
  40. End Sub
  41. Private Sub sink_OnObjectReady(ByVal objWbemObject As WbemScripting.ISWbemObject, ByVal objWbemAsyncContext As WbemScripting.ISWbemNamedValueSet)
  42. Debug.Print "Error!"
  43. End Sub
  44. Private Sub sink_OnProgress(ByVal iUpperBound As Long, ByVal iCurrent As Long, ByVal strMessage As String, ByVal objWbemAsyncContext As WbemScripting.ISWbemNamedValueSet)
  45. Debug.Print iUpperBound, iCurrent, strMessage
  46. End Sub