locked
How to Create a Metro Style Dynamic Library

    Question

  • On VS 11 Beta, I begin a New Project, and choose as follows:

    Installed

      Template

        Visual C++

            Windows Metro Style  - Blank Dynamic Library

    The new project introduces dllmain.cpp, and a few other files.

    Inside dllmain.cpp, I see this:

    // dllmain.cpp : Defines the entry point for the DLL application.
    #include "pch.h"

    BOOL APIENTRY DllMain(HMODULE /* hModule */, DWORD ul_reason_for_call, LPVOID /* lpReserved */)
    {
        switch (ul_reason_for_call)
        {
        case DLL_PROCESS_ATTACH:
        case DLL_THREAD_ATTACH:
        case DLL_THREAD_DETACH:
        case DLL_PROCESS_DETACH:
            break;
        }
        return TRUE;
    }

    Then inside MetroStyleDll.cpp file, I see this:

    #include "pch.h"
    #include "MetrostyleDll.h"

    Suppose, in MetrostyleDll.h, .cpp, I declare and define int MyAdd(int x, int y) function.

    How do I export this function in the MetroStyleDll.dll, so, I can use it from a MetroStyleApp?

    Is there any help document anywhere - DevCenter or VS 11 Beta Help? I could not locate "How to build Dynamic library in Metro Style app and export symbol(s) from it"

    Thanks in advance

    Thursday, May 3, 2012 5:22 PM

Answers