UWP 应用、Windows 运行时和 C 运行时UWP Apps, the Windows Runtime, and the C Run-Time

通用 Windows 平台 (UWP) 应用是在 Windows 8 上执行的 Windows 运行时中运行的程序。Universal Windows Platform (UWP) apps are programs that run in the Windows Runtime that executes on Windows 8. Windows 运行时是一个控制函数、变量以及可用于 UWP 应用的资源的可信环境。The Windows Runtime is a trustworthy environment that controls the functions, variables, and resources that are available to a UWP app. 但依据设计,Windows 运行时限制会阻止在 UWP 应用中使用大多数 C 运行库 (CRT) 功能。However, by design, Windows Runtime restrictions prevent the use of most C Run-Time Library (CRT) features in UWP apps.

Windows 运行时不支持以下 CRT 功能:The Windows Runtime does not support the following CRT features:

  • 与不受支持的功能相关的大多数 CRT 函数。Most CRT functions that are related to unsupported functionality.

    例如,UWP 应用无法使用 exec 和 spawn 系列的例程创建过程。For example, a UWP app cannot create a process by using the exec and spawn families of routines.

    对于 CRT 函数在 UWP 应用中不受支持的情况,其参考文章中会进行说明。When a CRT function is not supported in a UWP app, that fact is noted in its reference article.

  • 大多数多字节字符和字符串函数。Most multibyte character and string functions.

    但是,支持 Unicode 和 ANSI 文本。However, both Unicode and ANSI text are supported.

  • 控制台应用和命令行参数。Console apps and command-line arguments.

    但是,传统桌面应用仍支持控制台和命令行参数。However, traditional desktop apps still support the console and command-line arguments.

  • 环境变量。Environment variables.

  • 当前工作目录的概念。The concept of a current working directory.

  • 静态链接到 CRT 且使用 /MT/MTd 编译器选项生成的 UWP 应用和 DLL。UWP apps and DLLs that are statically linked to the CRT and built by using the /MT or /MTd compiler options.

    即,使用多线程、静态版本的 CRT 的应用。That is, an app that uses a multithread, static version of the CRT.

  • 使用 /MDd 编译器选项生成的应用。An app that's built by using the /MDd compiler option.

    即,多线程的特定于 DLL 的调试版本的 CRT。That is, a debug, multithread, and DLL-specific version of the CRT. 此类应用在 Windows 运行时中不受支持。Such an app is not supported on the Windows Runtime.

有关不适用于 UWP 应用的 CRT 函数的完整列表和替代函数的建议,请参阅通用 Windows 平台应用中不支持的 CRT 函数For a complete list of CRT functions that are not available in a UWP app and suggestions for alternative functions, see CRT functions not supported in Universal Windows Platform apps.

请参阅See Also

Windows 运行时不支持的 CRT 函数Windows Runtime Unsupported CRT Functions
按类别分的通用 C 运行时例程Universal C runtime routines by category