Q:

How can i suppport both Unicode and Multi-Byte Character Set in Static library (.lib)?

I am using visual studio 2015 and I want to write C++ static library that I can use in Unicode projects and in Multi-Byte projects, how I doing it right?
For example I have this code:
namespace Reg
{
    LONG WINAPI CreateKey(
        _In_  HKEY    hKey,
        _In_  LPCTSTR lpSubKey,
        _In_  REGSAM  samDesired,
        _Out_ PHKEY   phkResult
        )
    {
        return RegCreateKeyEx(hKey,
            lpSubKey,
            0, NULL,
            REG_OPTION_NON_VOLATILE,
            samDesired,
            NULL,
            phkResult,
            NULL);
    }
}

A:

Like Raymond Chen suggested in a comment, you can use two separate overloaded functions - one for Ansi, one for Unicode:
namespace Reg
{
    LONG WINAPI CreateKey(
        _In_  HKEY    hKey,
        _In_  LPCSTR  lpSubKey,
        _In_  REGSAM  samDesired,
        _Out_ PHKEY   phkResult
        )
    {
        return RegCreateKeyExA(hKey,
            lpSubKey,
            0, NULL,
            REG_OPTION_NON_VOLATILE,
            samDesired,
            NULL,
            phkResult,
            NULL);
    }

    LONG WINAPI CreateKey(
        _In_  HKEY    hKey,
        _In_  LPCWSTR lpSubKey,
        _In_  REGSAM  samDesired,
        _Out_ PHKEY   phkResult
        )
    {
        return RegCreateKeyExW(hKey,
            lpSubKey,
            0, NULL,
            REG_OPTION_NON_VOLATILE,
            samDesired,
            NULL,
            phkResult,
            NULL);
    }
}

Or, like rubenvb suggested, just forget about the Ansi function altogether, focus on just Unicode by itself:
namespace Reg
{
    LONG WINAPI CreateKey(
        _In_  HKEY    hKey,
        _In_  LPCWSTR lpSubKey,
        _In_  REGSAM  samDesired,
        _Out_ PHKEY   phkResult
        )
    {
        return RegCreateKeyExW(hKey,
            lpSubKey,
            0, NULL,
            REG_OPTION_NON_VOLATILE,
            samDesired,
            NULL,
            phkResult,
            NULL);
    }
}

