locked
What is wrong with my savefile routine whci saves two UINTs ? RRS feed

  • Question

  • 		void Renderer::savegame()
    		{
    			String^ fileName="arnold"; 
    		StorageFolder^ item = KnownFolders::PicturesLibrary;
     
      auto getFileOp = item->CreateFileAsync(fileName);
      getFileOp->Completed = ref new AsyncOperationCompletedHandler<StorageFile^>
        ([=](IAsyncOperation<StorageFile^>^ operation, AsyncStatus status)
      {
        auto storageFile = operation->GetResults();
        auto openOp = storageFile->OpenAsync(FileAccessMode::ReadWrite);
        openOp->Completed = 
          ref new AsyncOperationCompletedHandler <IRandomAccessStream^>
          ([=](IAsyncOperation<IRandomAccessStream^>^ operation, AsyncStatus status)
        {
          auto istream = operation->GetResults();
          auto dr = ref new DataWriter(istream);
               {
    
    			dr->WriteUInt32(time);
    			dr->WriteUInt32(screennumber);
    
    			///////////////////////////////////////////
    			 create_task(dr->StoreAsync()).then([this,dr](UINT16 bytesWritten)
                    {
    					
    					
    
    
    			 });
    
    
    
    
               
    	  } 
          
        
      });
    
      });
    		}


    n.Wright

    Sunday, September 22, 2013 4:24 AM

All replies

  • What is the symptom? What results do you get and how do they differ from what you expect?

    Sunday, September 22, 2013 2:53 PM
    Moderator
  • What is the symptom? What results do you get and how do they differ from what you expect?


    auto storageFile = operation->GetResults(); this line causes an exception.

    n.Wright

    Sunday, September 22, 2013 2:54 PM