Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to access namespace "windows"

#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

like image 479
Part Avatar asked May 22 '13 18:05

Part


1 Answers

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

like image 116
Matt Smith Avatar answered Sep 22 '22 21:09

Matt Smith