Is it possible to write a C++ .dll library to export methods which is written within namespace and class?
<p>I am newbie to C++ <code>dll</code> concept, just want to know, is it possible to write a C++ .dll library to export method which is written inside a namespace and a class?</p>

<p>What I have tried...</p>

<pre><code>/*JNLib.h Header File*/
#ifndef __JNLIB_H__
#define __JNLIB_H__
#include &lt;string&gt;
#include &lt;vector&gt;
using namespace std;

    namespace JNLib
    {
        class __declspec(dllexport) JNLibClass
        {
        public:
                void split_string();
        };
    }

#endif
</code></pre>

<p>and inside .cpp file</p>

<pre><code>/*JNLib.cpp File*/
#include "stdafx.h"
#include "JNLib.h"

    namespace JNLib
    {
        void JNLibClass::split_string()
        {
            cout&lt;&lt;"Library called"&lt;&lt;std::endl;
        }
    }
</code></pre>

<p>Now I am able to compile this project and getting <code>.dll</code> file successfully. In another project, I am able to load library (<code>.dll</code>) file successfully by using <code>LoadLibrary()</code> method but <code>GetProcAddress</code> method returns null each time. The code I have written is</p>

<pre><code>typedef void (CALLBACK  *f_funci)();
HINSTANCE dllinstance = LoadLibrary(L"..\\myLIB\\JNLib.dll");
f_funci funci = (f_funci)GetProcAddress(dllinstance, "split_string");
</code></pre>

<p>Please let me know what I am doing wrong. </p>