locked
how to use using namespace in native library(c++) for metro ui app

    Question

  • when I add new a native library(c++) for metro ui app.

    if t try use using namespace Windows::Networking::Sockets or Windows::Storage::Streams, it can't be found.

    I check the APP sample ,I found that the using namespace Windows::Networking::Sockets declaration in header file (mainpage.g.h or ***.g.h).

    Am I wrong using the header file .I don't understand.

    Friday, March 2, 2012 2:39 AM

Answers

  • Correct me if I'm not understanding the steps you took to create the problem. These are the steps I followed and they work as expected. Let me know if these steps are not working for you or reply with the steps you used to produce the problem.

    1. Create a new Visual C++ Windows Metro style 'Blank Application'

    2. Add a new project to the solution, Visual C++ Windows Metro style 'Blank Dynamic-Link Library'

    3. In the MetrostyleDll1.cpp add the following line: using namespace Windows::Networking::Sockets;

    Those steps are working for me in the Consumer Preview.

    Thanks,

    -David

    Friday, March 2, 2012 6:54 PM
    Moderator