title: GetProcAddress function returning NULL
body: <p>I tried to load C++ dll dynamically, first I loaded the dll using "LoadLibrary" function and it is getting its handle correctly. After that I tried to get the function pointer of DLL file function using "GetProcAddress", it is returning NULL. Please find my DLL code and testing application code and let me know where is going wrong in the code.</p>
  
  <p>dummy2.h</p>
  
  <pre><code>namespace newer
  {
    class dllclass
    {
      public:
          static __declspec(dllexport) int run(int a,int b);
    };
  }
  </code></pre>
  
  <p>dummy2.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  #include "dummy2.h"
  
  namespace newer
  {
    int dllclass::run(int a,int b)
    {
      return a+b;
    }
  }
  </code></pre>
  
  <p>dummy1.cpp</p>
  
  <pre><code>#include "stdafx.h" 
  #include &lt;windows.h&gt;
  
  #include &lt;iostream&gt;
  using namespace std;
  typedef int (*Addition)(int,int);
  
  int _tmain(int argc, _TCHAR* argv[])
  {
    Addition add;
    HINSTANCE hDLL;
    hDLL = LoadLibrary(TEXT("Dummy2.dll"));
  
    add = (Addition)GetProcAddress(hDLL, "run");  
  
    getchar();
    return 0;
  }
  </code></pre>
  
  <p>Please refer above code and guide me.</p>