You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CRT functions not supported in Universal Windows Platform apps | Microsoft Docs
ms.custom
ms.date
12/30/2016
ms.technology
cpp-windows
ms.topic
language-reference
ms.assetid
cbfc957d-6c60-48f4-97e3-1ed8526743b4
author
ghogen
ms.author
ghogen
ms.workload
cplusplus
CRT functions not supported in Universal Windows Platform apps
Many C runtime (CRT) functions are not available when you build Universal Windows Platform (UWP) apps. In some cases, workarounds are available—-for example, you can use Windows Runtime or Win32 APIs. However, in other cases, CRT functions have been banned because the features that correspond to them or the supporting APIs are not applicable to UWP apps. To look for an alternative method that's supported for the Windows Runtime, see Alternatives to Windows APIs in UWP apps.
The following table lists the CRT functions that are not available when you build UWP apps, and indicates any workarounds that apply.
Unsupported CRT Functions
_beep _sleep _seterrormode
These functions were obsolete in previous versions of the CRT. Also, the corresponding Win32 APIs are not available for UWP apps.
No workaround.
chdir _chdrive getcwd
These functions are obsolete or are not thread-safe.
The functionality is not available in UWP apps. A UWP app cannot invoke another UWP app or a desktop app.
No workaround.
_heapwalk _heapadd _heapchk _heapset _heapused
These functions are typically used to work with the heap. However, corresponding Win32 APIs are not supported in UWP apps. And, apps can no longer create or use private heaps.
No workaround. However, _heapwalk available in the DEBUG CRT, for debugging purposes only. These cannot be used in apps that are uploaded to the Microsoft Store.
The following functions are available in the CRT for UWP apps, but should be used only when the corresponding Win32 or Windows Runtime APIs cannot be used—for example, when you are porting large code bases
Single-byte string functions—for example, strcat, strcpy, strlwr, and so on.
Make your UWP apps strictly Unicode because all Win32 APIs and Windows Runtime APIs that are exposed use Unicode character sets only. Single-byte functions were left for porting large code bases, but should otherwise be avoided, and the corresponding wide char functions should be used instead when possible.
Stream IO and low-level file IO functions—for example, fopen, open, and so on.
These functions are synchronous, which is not recommended for UWP apps. In your UWP apps, use asynchronous APIs to open, read from, and write to files to prevent locking of the UI thread. Examples of such APIs are the ones in the Windows::Storage::FileIO class.
Windows 8.x Store apps and Windows Phone 8.x apps
In addition to the previously mentioned APIs, the following APIs are not available in Windows 8.x Store apps and Windows Phone 8.x apps.