Click here to Skip to main content
15,897,226 members

Comments by vidya_01 (Top 8 by date)

vidya_01 19-Jan-11 5:47am View    
I went thru that. I have implemented the following similar code in my application:
private void SystemEvents_PowerModeChanged(object sender, Microsoft.Win32.PowerModeChangedEventArgs e)
{
//The system is going into or resuming from standby
if (e.Mode == Microsoft.Win32.PowerModes.Suspend)
{
mLog.Info("System is going into standby, FST must shutdown");
clsMessageBroker.Shutdown();

}
else if (e.Mode == Microsoft.Win32.PowerModes.Resume)
{
mLog.Info("System is resuming from standby");

}
But this is not helping. I doubt the autodetect has got to do soemthing with the problem. It has a lot of handlers called thru the wndprc method, but i'm not sure how they r getting closed or which of htem is throwing the exception which is leading to the crash.
vidya_01 19-Jan-11 4:41am View    
Thanks so much! The application in the below link works great! but I'm looking for a similar one in C#. Or do you any work around ?
vidya_01 18-Jan-11 23:17pm View    
Hi Espen, thanks for the input. The VISTA system has .net f/w 3.5 sp1 installed.
However I found out that the method asdataview is supported in VISTA sp1 or later.
I want to know if there is a work around for VISTA with versions previous to SP1.
vidya_01 18-Jan-11 0:51am View    
EnumerableRowCollection<devicevariablesdataset.devicevariablelistrow> query =
from rows in mVariableList.AsEnumerable()
where rows.Monitored == true
orderby rows.VariableName
select rows;

mSelectedVariablesLock.EnterWriteLock();
try
{
mSelectedVariables = query.AsDataView();// throwing exception
}
finally
{
mSelectedVariablesLock.ExitWriteLock();
}
vidya_01 18-Jan-11 0:51am View    
this is the codepiece

EnumerableRowCollection<devicevariablesdataset.devicevariablelistrow> query =
from rows in mVariableList.AsEnumerable()
where rows.Monitored == true
orderby rows.VariableName
select rows;

mSelectedVariablesLock.EnterWriteLock();
try
{
mSelectedVariables = query.AsDataView();// throwing exception
}
finally
{
mSelectedVariablesLock.ExitWriteLock();
}