title: Specify ordinals of C++ exported functions in a DLL
body: <p>I am writing a DLL with mixed C/C++ code. I want to specify the ordinals of the functions I'm exporting. So I created a .DEF file that looks like this</p>
  
  <pre><code>LIBRARY LEONMATH
  
  EXPORTS
  
      sca_alloc   @1
      vec_alloc   @2
      mat_alloc   @3
  
      sca_free    @4
      vec_free    @5
      mat_free    @6
  
      ...
  </code></pre>
  
  <p>I would like to specify the ordinals of my C++ functions and class methods too. I have tried using the Dependency Walker to add the mangled names of my functions to the .DEF file:</p>
  
  <pre><code>    ??0CScalar@@QAE@XZ      @25
      ??0CScalar@@QAE@O@Z     @26
      ??0CScalar@@QAE@ABV0@@Z @27
      ??1CScalar@@QAE@XZ      @28
  </code></pre>
  
  <p>But this has failed. Any ideas why this could be happening?</p>
  
  <hr>
  
  <p><b>EDIT:</b> kauppi made a good observation, so I'm adding more information to the question.</p>
  
  <ul>
  <li><b>Platform:</b> Windows (and I'm not interested in portability)</li>
  <li><b>Compiler:</b> Microsoft's C++ compiler (I'm using VS2005)</li>
  <li><b>Why I want to do this?:</b> Using the ordinals has the advantage of letting me call exported C++ functions from C code.</li>
  </ul>