I found a workaround that could maybe give anyone a hint of whats going on here... If I change my regional settings from swedish to english then my application works fine even with 200 ms poll.
I found another post that seems related http://www.vbforums.com/showthread.php?t=560488 Does anyone have any idea of why this is happening and how I could solve it to work for all languages? On 17 Dec, 14:31, Marcus <[email protected]> wrote: > thanks for looking into this. > > Here is the details from the caught exception: > > System.Management.ManagementException was caught > Message="Unparsable query. " > Source="System.Management" > StackTrace: > at System.Management.ManagementException.ThrowWithExtendedInfo > (ManagementStatus errorCode) > at System.Management.ManagementEventWatcher.Start() > at SystemWatcher.ProcessWatcher.startWatching() in C:\Data > \Visual Studio 2008\Projects\SystemWatcher\SystemWatcher > \ProcessWatcher.cs:line 62 > InnerException: > > On 17 Dec, 14:09, Processor Devil <[email protected]> wrote: > > > > > Well, I can give you thousands of another unreasonable fixes or you can send > > us the text of the exception :). > > > 2009/12/17 Marcus <[email protected]> > > > > But the TimeSpan constructor wants integers, so 0.2 is not a valid > > > value... > > > > On 17 Dec, 12:43, Processor Devil <[email protected]> wrote: > > > > sry, wrongly typed, I wanted to say to try 0.2 seconds, not 2 seconds :D > > > > > 2009/12/17 Processor Devil <[email protected]> > > > > > > It shouldn't make difference, but try to use 2 seconds instead of 200 > > > > > miliseconds, if it works then there is some problem with TimeSpan > > > conversion > > > > > and not the WQL Query... > > > > > > 2009/12/17 Marcus <[email protected]> > > > > > > Can someone explain to me why this code works (C#): > > > > > >> WqlEventQuery procCreateQuery = new WqlEventQuery( > > > > >> "__InstanceCreationEvent", > > > > >> new TimeSpan(0, 0, 1), > > > > >> "TargetInstance isa \"Win32_Process\"); > > > > > >> and also this works... > > > > > >> WqlEventQuery procCreateQuery = new WqlEventQuery( > > > > >> "__InstanceCreationEvent", > > > > >> new TimeSpan(200), > > > > >> "TargetInstance isa \"Win32_Process\"); > > > > > >> ...while the following gets "unparsable query": > > > > > >> WqlEventQuery procCreateQuery = new WqlEventQuery( > > > > >> "__InstanceCreationEvent", > > > > >> new TimeSpan(0, 0, 0, 0, 200), > > > > >> "TargetInstance isa \"Win32_Process\"); > > > > > >> Another strange thing is that I think I used to run the one that now > > > > >> fails, successfully aswell, but all of a sudden I can't. > > > > >> So I am allowed to poll at 1 second intervall aswell as 20 > > > > >> microseconds intervall but NOT at 200 milliseconds intervall? > > > > > >> Does someone know what is going on here?- Dölj citerad text - > > > > > - Visa citerad text -- Dölj citerad text - > > > - Visa citerad text -- Dölj citerad text - > > - Visa citerad text -
