title: C++ GetProcAddress not working
body: <p>I have following code:</p>
  
  <pre><code>typedef int (WINAPI* fnEngineStart)();
  
  
  int __stdcall EngineStart()
  {
  BOOL FreeResult = 0, RunTimeLinkSuccess = 0; //variables for later use
  HMODULE LibraryHandle = 0; //Here the handle to API module/dll will be stored.
  fnEngineStart fn = 0;
  
  LibraryHandle = AfxLoadLibrary(L"FlowEngine.dll"); //get the handle of our API module
  //so it will now be loaded.
  if (LibraryHandle != NULL) //if the library loading was successfull..
  {
      fn = (fnEngineStart)GetProcAddress(LibraryHandle,
          "fnEngineStart");
      if (RunTimeLinkSuccess = (fn != NULL)) //if operation was successful...
      {
          int ReturnValue = fn(); //call messageboxa function
          //from user32.dll
      }
      else
      {
          MessageBox(0, L"Error", 0, 0);
      }
      FreeResult = FreeLibrary(LibraryHandle);
      //from this process...
      return FreeResult; //routine was successful
  }
  return EXIT_FAILURE; //else, it failed
  }
  </code></pre>
  
  <p>This code works perfectly for example user32.dll and MessageBoxA but not my own dll...</p>
  
  <pre><code>int __declspec(dllexport) __stdcall fnEngineStart()
  {
     MessageBox(0, L"Succes!", 0, 0);
     return 0;
  }
  </code></pre>
  
  <p>How do I make this to work for my own dll as well?
  Thanks in advance.</p>