title: Getting error 127 when calling GetProcAddress
body: <p>I am writing a global hook for WH_GETMESSAGE. But I am getting the error code 127 i.e.,ERROR_PROC_NOT_FOUND, when calling the GetProcAddress function from the dll. Its unable to find the GetMsgProc. Any idea why?</p>
  
  <p>Also, I am new to this kind of programming, so apologies for any mistake that's not expected.</p>
  
  <p>DLL File:</p>
  
  <pre><code>#include "windows.h"
  #include &lt;stdio.h&gt;
  
  BOOL APIENTRY DllMain(HANDLE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved)
  {
      return TRUE;
  }
  
  __declspec(dllexport) LRESULT CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam)
  {
      MessageBox(NULL, TEXT("I am in"),TEXT("In a DLL"), MB_OK);
  
      return CallNextHookEx(NULL, nCode, wParam, lParam);
  }
  </code></pre>
  
  <p>Program Loading the DLL file:</p>
  
  <pre><code>#include &lt;windows.h&gt;
  #include &lt;tchar.h&gt;
  #include &lt;stdio.h&gt;
  
  typedef LRESULT(CALLBACK *LPGetMsgProc)(int nCode, WPARAM wParam, LPARAM lParam);
  
  int main()
  {
      HMODULE hDll = LoadLibrary(_T("../../dllTouchInputHook/x64/Debug/dllTouchInputHook.dll"));
      LPGetMsgProc proc = (LPGetMsgProc)GetProcAddress(hDll, "GetMsgProc");
      if (proc == NULL) {
          printf("The error code is %d", GetLastError());
      }
  
      HHOOK hMsgHook = SetWindowsHookEx(WH_GETMESSAGE, proc, hDll, 0);
  
      MSG msg;
      while (GetMessage(&amp;msg, NULL, 0, 0) &gt; 0) {
  
          TranslateMessage(&amp;msg);
          DispatchMessage(&amp;msg);
      }
  
      UnhookWindowsHookEx(hMsgHook);
  
      return 0;
  }
  </code></pre>