Mr.Woland
27th July 2011, 21:19
In thread run() function I'm using a disphelper (http://disphelper.sourceforge.net/) functional.
This function is implementing a request to WMI for monitor a system events:
Code:
try
{
const wchar_t * Query = (const wchar_t *) this-> TriggerRequest.utf16 ();
dhCheck (dhGetObject (L "winmgmts: {impersonationLevel = impersonate, (Security)}! \ \ \ \. \ \ root \ \ cimv2", NULL, & wmiSvc));
dhCheck (dhGetValue (L "% o", & wmiEventSrc, wmiSvc, L ". ExecNotificationQuery (% S)", Query));
emit this-> TriggerState (this-> TriggerName, 1);
while (TRUE)
{
CDispPtr wmiLatestEvent;
dhCheck (dhGetValue (L "% o", & wmiLatestEvent, wmiEventSrc, L ". NextEvent"));
emit this-> Triggered (this-> TriggerName, this-> GenerateTriggerMsg (wmiLatestEvent), this-> TriggerIcon);
wmiLatestEvent.Dispose ();
}
}
catch (string errstr)
{
ErrorMSG = this-> GenerateErrorMSG (QString:: fromStdString (errstr));
emit this-> TriggerState (this-> TriggerName, -1);
}
problem follows on line
Code:
dhCheck (dhGetObject (L "winmgmts: {impersonationLevel = impersonate, (Security)}! \ \ \ \. \ \ root \ \ cimv2", NULL, & wmiSvc));
fails with the message:
Member:
Function: GetObject
Error In: GetObjectEx
Error: Neioaene? Aneay ioeaea
Code: 800401e4 (http://www.google.ru/search?client=opera&rls=ru&q=Code:+800401e4&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest)
Source: Application "
But before the program fails with the message Runtime error.
And even earlier (and now) in another application, this code (in multiple threads) working perfectly.
also, in class constructor such code works fine without any problems.
Out of the run() function this code works;
What's the problem?
Environment variables, configuration files (*.pro) (except a list of files) are identical to the working and nonworking applications.
Shl.
Help pliz.
3 days of debuging ....
This function is implementing a request to WMI for monitor a system events:
Code:
try
{
const wchar_t * Query = (const wchar_t *) this-> TriggerRequest.utf16 ();
dhCheck (dhGetObject (L "winmgmts: {impersonationLevel = impersonate, (Security)}! \ \ \ \. \ \ root \ \ cimv2", NULL, & wmiSvc));
dhCheck (dhGetValue (L "% o", & wmiEventSrc, wmiSvc, L ". ExecNotificationQuery (% S)", Query));
emit this-> TriggerState (this-> TriggerName, 1);
while (TRUE)
{
CDispPtr wmiLatestEvent;
dhCheck (dhGetValue (L "% o", & wmiLatestEvent, wmiEventSrc, L ". NextEvent"));
emit this-> Triggered (this-> TriggerName, this-> GenerateTriggerMsg (wmiLatestEvent), this-> TriggerIcon);
wmiLatestEvent.Dispose ();
}
}
catch (string errstr)
{
ErrorMSG = this-> GenerateErrorMSG (QString:: fromStdString (errstr));
emit this-> TriggerState (this-> TriggerName, -1);
}
problem follows on line
Code:
dhCheck (dhGetObject (L "winmgmts: {impersonationLevel = impersonate, (Security)}! \ \ \ \. \ \ root \ \ cimv2", NULL, & wmiSvc));
fails with the message:
Member:
Function: GetObject
Error In: GetObjectEx
Error: Neioaene? Aneay ioeaea
Code: 800401e4 (http://www.google.ru/search?client=opera&rls=ru&q=Code:+800401e4&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest)
Source: Application "
But before the program fails with the message Runtime error.
And even earlier (and now) in another application, this code (in multiple threads) working perfectly.
also, in class constructor such code works fine without any problems.
Out of the run() function this code works;
What's the problem?
Environment variables, configuration files (*.pro) (except a list of files) are identical to the working and nonworking applications.
Shl.
Help pliz.
3 days of debuging ....