title: how to see what is ordinal x in my dll
body: <p>The client has reported me that my dll gives "ordinal 5 not located" error when loading it. To see what ordinal 5 is, I have found this:</p>
  
  <p><a href="https://stackoverflow.com/questions/3598108/how-can-i-call-a-exported-function-using-ordinal-number">How can I call a exported function using ordinal number</a></p>
  
  <p>But the example in the answer of there gives me error.</p>
  
  <pre><code>#include &lt;windows.h&gt;
  #include &lt;winuser.h&gt;
  #include &lt;winbase.h&gt;
  
  int main()
  {
      const wchar_t str[200] = 
      L"D:\\mydll.dll";
      HANDLE mydll = LoadLibrary(str);
  
      int ordinal = 5;
      FARPROC fn = GetProcAddress(mydll, MAKEINTRESOURCE(ordinal));
  
      return 0;
  }
  </code></pre>
  
  <p>The error is:</p>
  
  <blockquote>
    <p>main.cpp:15: error: invalid conversion from 'HANDLE {aka void*}' to
    'HMODULE {aka HINSTANCE__*}' [-fpermissive]
         FARPROC fn = GetProcAddress(mydll, MAKEINTRESOURCE(ordinal));</p>
    
    <p>main.cpp:15: error: cannot convert 'LPWSTR {aka > wchar_t*}' to
    'LPCSTR {aka const char*}' for argument '2' to 'int
    (<strong>attribute</strong>((<strong>stdcall</strong>)) * GetProcAddress(HMODULE, LPCSTR))()'
    FARPROC fn = GetProcAddress(mydll, MAKEINTRESOURCE(ordinal));</p>
  </blockquote>
  
  <p>Any idea on what I am trying to do?
  How can I find what is problem with loading my dll? What is ordinal 5?</p>