C++ and Beyond 2011: Scott, Andrei and Herb - Ask Us Anything

Sign in to queue

The Discussion

  • User profile image
    PhrostByte

    About 34min in, Herb mentions that Windows has asynchronous file opening/closing, demanded by the Office team. What are the functions? I've been wanting this for a very long time!

    I know WinRT has async opening, but I assumed it was merely using a thread pool in the background.

  • User profile image
    Andi

    maybe http://msdn.microsoft.com/en-us/library/windows/desktop/aa365468(v=vs.85).aspx answers some of your questions...

  • User profile image
    anonymous

    What about C++ everywhere, including Windows Phone?
    People are asking for it here: http://wpdev.uservoice.com/forums/110705-app-platform/suggestions/1755203-native-sdk

  • User profile image
    PhrostByte

    @Andi: Reading and writing from a file asynchronously has been possible for some time.  It's opening/closing that I'm curious about. It's not normally an issue, but when you open a file over a network or from a CD there can be serious latency -- so true async opening/closing has always been a dream of mine. I was quite surprised when Herb mentioned it already being there, so I hope he didn't misspeak!

  • User profile image
    Fab

    @PhrostByte, @ Andi: Maybe the wanted link is: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365683(v=VS.85).aspx [excerpt: "A process opens a file for asynchronous I/O in its call to CreateFile by specifying the FILE_FLAG_OVERLAPPED flag in the dwFlagsAndAttributes parameter."] (?)

  • User profile image
    Fab

    Nevermind, I think PhrostB want the time between the seek of the file and the return of the handler be async.

  • User profile image
    C64

    UTF-16 is a good Unicode encoding for text processing; UTF-8 is good for external storage and interchange.

    I like using UTF-16 inside app boundaries (considering that Windows API's use UTF-16), UTF-8 outside app boundaries, and convert between the two encodings at the boundary.

    See also this: http://unicode.org/notes/tn12/

    Note that also Java and C# (.NET) use UTF-16 as Unicode encoding for their string classes.

Add Your 2 Cents