Results 1 to 2 of 2

Thread: [RESOLVED] Problem with CradlePresent SystemState

  1. #1

    Thread Starter
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Resolved [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

  2. #2

    Thread Starter
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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
  •  



Click Here to Expand Forum to Full Width