locked
GestureRecognizerSample throws exceptions on saving state on exit... RRS feed

  • Question

  • This sample inspired our technique which is also failing on the same lines of code....These throw on

    if(settings->Containers->HasKey(name))

    Is this something that is going to be fixed or is there an issue with this technique?

    First-chance exception at 0x77423F29 (KernelBase.dll) in GestureRecognizerSample.exe: 0x000006BA: The RPC server is unavailable.

    First-chance exception at 0x77423F29 (KernelBase.dll) in GestureRecognizerSample.exe: 0x0000000E: Not enough storage is available to complete this operation.

    Windows::Foundation::Collections::

    IPropertySet^ GestureRecognizerSample::GetObjectProperties(_In_Platform::String^ name)

    {

        Windows::Storage::

    ApplicationDataContainer^ settings = Windows::Storage::ApplicationData::Current->LocalSettings;

        Windows::Storage::

    ApplicationDataContainer^ container = nullptr;

       

    if(settings->Containers->HasKey(name))

        {

            container = settings->Containers->Lookup(

    name);

        }

       

    else


        {

            container = settings->CreateContainer(

    name, Windows::Storage::ApplicationDataCreateDisposition::Always);

        }

       

    returncontainer->Values;

    }

    Monday, July 8, 2013 5:59 PM

Answers

  • A "first chance" exception is not the same as an unhandled exception. It's just the debugger warning you that an exception was thrown somewhere, thus giving you a chance to look at it before any exception handling happens (such that if it is ultimately unhandled (or causes problems elsewhere) then you will have had a chance to look at it before any state data (such as the call stack or local variable values) is modified or lost.

    It's quite possible that the exception will be handled internally and if so then the program would proceed without raising a real exception (i.e. one that doesn't say "first chance"). If you get first chance exceptions then once you've looked at anything you want to look at (which is probably nothing here) just click continue.


    Visual C++ MVP | Website | Blog | @mikebmcl | Windows Store DirectX Game Template

    Tuesday, July 9, 2013 8:38 PM

All replies

  • Do you see this problem in the sample itself or only in your code?

    If in the sample, do you mean the Input: Manipulations and gestures (C++) sample (Windows 8.1) sample? What are the repro steps? I was not able to reproduce the problem with that sample. The quoted code ran without error when I ran the app and then dragged its window down to suspend it.

    --Rob

    Monday, July 8, 2013 7:27 PM
    Moderator
  • A "first chance" exception is not the same as an unhandled exception. It's just the debugger warning you that an exception was thrown somewhere, thus giving you a chance to look at it before any exception handling happens (such that if it is ultimately unhandled (or causes problems elsewhere) then you will have had a chance to look at it before any state data (such as the call stack or local variable values) is modified or lost.

    It's quite possible that the exception will be handled internally and if so then the program would proceed without raising a real exception (i.e. one that doesn't say "first chance"). If you get first chance exceptions then once you've looked at anything you want to look at (which is probably nothing here) just click continue.


    Visual C++ MVP | Website | Blog | @mikebmcl | Windows Store DirectX Game Template

    Tuesday, July 9, 2013 8:38 PM