看着winapifamily.h,您可以看到這些宏用於確定您擁有哪個平臺以及哪些API適合您的平臺。
/*
* Windows APIs can be placed in a partition represented by one of the below bits. The
* WINAPI_FAMILY value determines which partitions are available to the client code.
*/
#define WINAPI_PARTITION_DESKTOP 0x00000001
#define WINAPI_PARTITION_APP 0x00000002
/*
* A family may be defined as the union of multiple families. WINAPI_FAMILY should be set
* to one of these values.
*/
#define WINAPI_FAMILY_APP WINAPI_PARTITION_APP
#define WINAPI_FAMILY_DESKTOP_APP (WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_APP)
/*
* A constant that specifies which code is available to the program's target runtime platform.
* By default we use the 'desktop app' family which places no restrictions on the API surface.
* To restrict the API surface to just the App API surface, define WINAPI_FAMILY to WINAPI_FAMILY_APP.
*/
#ifndef WINAPI_FAMILY
#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
#endif
/* Macro to determine if a partition is enabled */
#define WINAPI_FAMILY_PARTITION(Partition) ((WINAPI_FAMILY & Partition) == Partition)
/* Macro to determine if only one partition is enabled from a set */
#define WINAPI_FAMILY_ONE_PARTITION(PartitionSet, Partition) ((WINAPI_FAMILY & PartitionSet) == Partition)
所以你WINAPI_PARTITION_DESKTOP
如果您是在桌面家庭系統的運行將只設置。
但是,解決方案「A」和「B」在相同系統,相同操作系統,相同平臺上編譯和運行。我真的想知道它是否可以是VS2008中的任何設置,這導致了兩種解決方案的差異。 – codeLover 2013-03-08 11:08:16
@codeLover AFAIK這是用於Metro應用程序和桌面應用程序,上次我查看時,Metro在VS2008中不受支持。我錯了嗎? – 2013-03-08 11:09:26
在桌面Win7上運行這兩個解決方案,它們都是桌面應用程序。 – codeLover 2013-03-08 11:31:59