Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8653095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:27:40+00:00 2026-06-12T14:27:40+00:00

We have a long established, greatly multiplatform codebase that is currently being ported to

  • 0

We have a long established, greatly multiplatform codebase that is currently being ported to WinRT. One of the challenges we’re facing is how to handle WinRT’s asynchronous style.

For example, we are unsure how to handle WinRT’s async file operations. Unsurprisingly, our codebase’s API is synchronous. A typical example is our File::Open function which attempts to open a file and return with success or failure. How can we call WinRT functions and yet keep the behavior of our functions the same?

Note that we are unfortunately constrained by legacy: we cannot simply go and change the API to become asynchronous.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:27:41+00:00Added an answer on June 12, 2026 at 2:27 pm

    I assume you wish to reimplement the library to support WinRT apps while not changin the definitions of the APIs so that existing applications remain compatible.

    I think that if you don’t include the await keyword when calling an async method you will not do an async operation, it should execute in a synchronous way. But it really doesn’t work if the method returns a value (in my experience).

    I’ve been using this code to make a file operation synchronous:

    IAsyncOperation<string> contentAsync = FileIO.ReadTextAsync(file);
    contentAsync.AsTask().Wait();
    string content = contentAsync.GetResults();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have Long Pres Gesture Recognizers on four different TableViews (two in each
One thing with which I have long had problems, within the CakePHP framework, is
I have a large high quality c# framework codebase that I nevertheless want to
I have a long-established routine written in Visual C++ running on PC which calculates
I have long since forgotten the password for the root user on one of
Let's say I have a long established repository like this: interface IDonutRepository { public
I have long cycles of GC. from checks I saw there are too many
Apple have long blocked mobile Safari from playing sounds – the usual JavaScript commands
I have long HTTP request ( generating large Excel file - about 60K records
I have long file with the following list: /drivers/isdn/hardware/eicon/message.c//add_b1() /drivers/media/video/saa7134/saa7134-dvb.c//dvb_init() /sound/pci/ac97/ac97_codec.c//snd_ac97_mixer_build() /drivers/s390/char/tape_34xx.c//tape_34xx_unit_check() (PROBLEM)/drivers/video/sis/init301.c//SiS_GetCRT2Data301() /drivers/scsi/sg.c//sg_ioctl()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.