title: Why GetProcAddress() is not working?
body: <p>I have quite novice to DLL programming.</p>
  
  <p>I have created a DLL project as,</p>
  
  <p>In DLL project <code>SimpleH.h</code></p>
  
  <pre><code>namespace ME{
      class base
      {
      public:
          static __declspec(dllexport) void Hello();
      };
  }
  __declspec(dllexport) void HelloWorld();
  </code></pre>
  
  <p><code>DLL.cpp</code></p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  #include "SimpleH.h"
  using namespace std;
  namespace ME
  {
      void base::Hello()
          {
              cout &lt;&lt; "Hello World\n";
          }
  }
  void HelloWorld()
  {
      cout &lt;&lt; "Hello I am world\n";
  }
  </code></pre>
  
  <p>I have created an <code>.exe</code>.</p>
  
  <p><code>Main.exe</code></p>
  
  <pre><code>    #include "stdafx.h"
      #include &lt;stdlib.h&gt;
      #include &lt;Windows.h&gt;
      #include &lt;iostream&gt;
  
      using namespace std;
      typedef void (*FunctionFunc)();
      typedef void (*FunctionAno)();
      int _tmain(int argc, _TCHAR* argv[])
      {
  
          FunctionFunc _FunctionFunc;
          FunctionAno _FunctionAno;
          HINSTANCE hInstLibrary = LoadLibrary(L"MyDLL.dll");
          if(hInstLibrary)
          {
              /*Problem Happens here*/
              _FunctionFunc = (FunctionFunc)GetProcAddress(hInstLibrary, "Hello");
              _FunctionAno = (FunctionFunc)GetProcAddress(hInstLibrary, "HelloWorld");
  /**/
              if(_FunctionFunc)
              {
                  _FunctionFunc(); 
              }
              if(_FunctionAno)
              {
                  _FunctionAno();
              }
            DWORD error = ::GetLastError();
            if (error)
            {
              LPVOID lpMsgBuf;
              LPVOID lpDisplayBuf;
  
              FormatMessage(
              FORMAT_MESSAGE_ALLOCATE_BUFFER | 
              FORMAT_MESSAGE_FROM_SYSTEM |
              FORMAT_MESSAGE_IGNORE_INSERTS,
              NULL,
              error,
              MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
              (LPTSTR) &amp;lpMsgBuf,
              0, NULL );
  
            }
          }
          FreeLibrary(hInstLibrary);
          system("pause");
          return 0;
      }
  </code></pre>
  
  <p>hInstance is getting updated properly.
  But the <code>GetProcAddress()</code> are not getting updated.
  Please help me.
  Where is it going wrong?</p>