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.
The compiled DLL exported functions cannot be found by Delphi.
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"):
?MM_End@@YAH_N@Z
?MM_GetCurrentPosition@@YAHPAN0000@Z
?MM_GetWindow@@YAHPAN000@Z
?MM_MarkGetLinkFile@@YAHPAXPADH@Z
?MM_Start@@YAH_N@Z
The C++ header code looks like this:
...
#define MMAPI_API __declspec(dllexport)
...
MMAPI_API int MM_Start(bool run_mmnav);
MMAPI_API int MM_End(bool close_mmnav);
...
With reference to https://msdn.microsoft.com/en-AU/library/dt232c9t%28v=vs.90%29.aspx. I have tried several variations of __stdcall and _cdecl but cannot get MS Visual C++ to compile the export table with NULL terminated strings.