|
-
May 16th, 2008, 03:17 PM
#1
[RESOLVED] Problem with CradlePresent SystemState
Hello
In order for my Application to know when it is able to synchronise with the back end server, I am trying to use the SystemState CradlePresent property, as follows:
Code:
Sysyemstate cradleState = new SystemState(SystemProperty.CradlePresent);
cradleState.Changed += new ChangeEventHandler(cradleState_Changed);
And then I assigning an Event Handler to when the State changes. However, when I try and access the Property as follows:
Code:
return ((int)cradleState.CurrentValue != 0);
I get a NullReferenceException
To explain this slightly more, I only get the Exception when I run the code on a Device Emulator, when I run it on an actual device then I don't get the exception. Even though i have used Device Emulator Manager to make sure that the device is cradled?!?!?
Any thoughts on why this would be happening?
Thanks
Gary
-
May 23rd, 2008, 04:20 PM
#2
Re: Problem with CradlePresent SystemState
Hello,
For anyone who is interested, I have found the solution to this now, and the solution was to do with ActivSync.
In the Connection Settings window of ActivSync, I had to change the "Allow Connections to one of the following:" setting to include DMA. From there, once I started up the Emulator, I was able to change the Cradled State, and this was then reflected in the code that I was executing.
Thanks
Gary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|