title: MS Visual C\C++ Compiling DLL for use by Delphi?
body: <p>My experience is with Delphi XE2 and I am not familiar with MS Visual C/C++. I am trying to compile some MS Visual C++ code into a DLL I can use from Delphi.</p>
  
  <p>The compiled DLL exported functions cannot be found by Delphi.</p>
  
  <p>Using a hex editor the DLL export table looks like the following snippets and does not have NULL terminated function names (a NULL ASCII char is positioned following the eol "Z"):</p>
  
  <pre><code>      ?MM_End@@YAH_N@Z
        ?MM_GetCurrentPosition@@YAHPAN0000@Z
        ?MM_GetWindow@@YAHPAN000@Z
        ?MM_MarkGetLinkFile@@YAHPAXPADH@Z
        ?MM_Start@@YAH_N@Z
  </code></pre>
  
  <p>The C++ header code looks like this:</p>
  
  <pre><code>    ...
      #define MMAPI_API __declspec(dllexport)
      ...
      MMAPI_API int MM_Start(bool run_mmnav);
      MMAPI_API int MM_End(bool close_mmnav);
      ...
  </code></pre>
  
  <p>With reference to <a href="https://msdn.microsoft.com/en-AU/library/dt232c9t%28v=vs.90%29.aspx" rel="nofollow">https://msdn.microsoft.com/en-AU/library/dt232c9t%28v=vs.90%29.aspx</a>. I have tried several variations of __stdcall and _cdecl but cannot get MS Visual C++ to compile the export table with NULL terminated strings.</p>