I've had a look at this before and never quite got it. I think I'm missing some vital piece of the puzzle...
Okay, say I want to monitor things being added and removed to IE's favorites list. There's something under 'Management Events' that looks promising. I right clock on 'Management Events' and 'Add Event Query...'. I then open the 'root\RSOP\User' node in the tree and select 'RSOP_IEFavoriteItem'. I enable 'Object creation, modification and deletion' in the drop down. After I select 'OK' a new node appears under 'Management Events'. I can look at the properties for this event and 'Refresh' but nothing seems to happen (even after addin a new favorite). Where does one view these events?
I'm confused. Please help me out...
Thanks, Jamie.
Jamie - Drag and drop this event query node onto any open component designer (i.e on any form in your application) and voila - you have an object that represents the event you wish to work with. (I'm simplifying this of course. You need to know how to work with a WMI object and understand what it represents in order to go through with this)
Thanks. I'll also read that sample book chapter you just posted about. Hopefully that will give me more of a clue.
BTW, how good a fit do you think WMI would be for unit testing results? I'm finding getting test results back difficult in multi process applications. I'm wondering it this is the way to go. At the moment I'm using .NET Remoting to cummunicate with the test runner. This problem with this is it has side effects if you're writing certain types of applications (i.e. ones that use remoting or context themselves). It's also a problem if the tests are running in a process that the test runner spins up.
I'm not sure how one would use WMI for unit testing. Perhaps only to check physical results on disk or stuff like that? I'm not sure what WMI ability your referring to..
As an out of band way of getting events out of an application (ie one that doesn't involve .NET Remoting side effects). Each assertion and test result could be an event. I think there's also a way of making an object accessable vier WMI. The test runner could be made available this way.
At the moment in process unit tests are very well catored for (ie of libraries). I'm thinking more about out of proc testing.
Cool idea. I don't know how feasible it is though. I have not worked with event on the WMI front. Mainly done more "manual" labor or so...