locked
System.Runtime.InteropServices.SEHException from GetFolderAsync

    Question

  • Given:

    	concurrency::task< StorageFolder^ > getRootFolder( Windows::Storage::KnownFolders::PicturesLibrary->GetFolderAsync( "Test1" ) );
    	StorageFolder^ rootFolder = getRootFolder.get();
    

    I end up with an SEHException getting thrown when I try to step over the get call.  I have included an image that shows my permissions, set to allow access to PicturesLibrary, and my pictures library which shows I have a Test1 folder within it.

    I am not clear why I am getting an exception.

    Regards, Guy

    Monday, April 23, 2012 6:13 PM

Answers

  • Thanks for the response.  It prompted me to jump onto another machine and another project and try it.  As it turns out, I was calling the get function from the UI thread which you are not supposed to do.  The weird thing and the part that confused me was that it wouldn't crash all the time.


    Thanks, Guy

    • Marked as answer by gnichola Tuesday, April 24, 2012 10:50 PM
    Tuesday, April 24, 2012 10:50 PM

All replies

  • Hello,

    Would you please provide us the whole codes to reproduce this issue?
    I test this codes and did not find any error.

    Or you can follow the File access sample codes
    http://code.msdn.microsoft.com/windowsapps/File-access-sample-d723e597

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, April 24, 2012 3:23 AM
  • Thanks for the response.  It prompted me to jump onto another machine and another project and try it.  As it turns out, I was calling the get function from the UI thread which you are not supposed to do.  The weird thing and the part that confused me was that it wouldn't crash all the time.


    Thanks, Guy

    • Marked as answer by gnichola Tuesday, April 24, 2012 10:50 PM
    Tuesday, April 24, 2012 10:50 PM