سؤال

#include<iostream>
#include<string.h>
#include<Windows.h>
.
.
.
using namespace Windows::Networking::Connectivity;
.
.
.
ConnectionProfile^ internetConnectionProfile = NetworkInformation::GetInternetConnectionProfile();
.
.
.

The above is the code but it is showing

error C2653: 'Windows' : is not a class or namespace name

What do I do? Common Language Runtime Support(/clr) is set

هل كانت مفيدة؟

المحلول

I think you want to use C++/CX (not C++/CLI). The languages are practically identical (in terms of how their syntax looks). But building them is not the same: you enable C++/CX by using the /ZW compiler option (which is turned on by default when you create a Windows Store App).

In the UI, the /ZW option is listed as "Consume Windows Runtime Extension"

See:

http://msdn.microsoft.com/en-us/magazine/dn166929.aspx

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top