Skip to content

Instantly share code, notes, and snippets.

@nigel-sampson
Created April 22, 2013 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nigel-sampson/5431705 to your computer and use it in GitHub Desktop.
Save nigel-sampson/5431705 to your computer and use it in GitHub Desktop.
C++ Async
create_task(FileIO::ReadTextAsync(file)).then([this, file](task<String^> task)
{
try
{
String^ fileContent = task.get();
OutputTextBlock->Text = "The following text was read from '" + file->Name + "':\n\n" + fileContent;
}
catch(COMException^ ex)
{
rootPage->HandleFileNotFoundException(ex);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment