visual studio WINAPI directive
-
Hi guys I have the following problem when I insert the WINAPI calling convention while exporting a function for example __declspec(dllexport) VOID ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv); the Visual Studio compiler exports the function in the dll as _ServiceMain@8 while without the WINAPI the ServiceName is exported like ServiceMain. Why is this happening??
-
Hi guys I have the following problem when I insert the WINAPI calling convention while exporting a function for example __declspec(dllexport) VOID ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv); the Visual Studio compiler exports the function in the dll as _ServiceMain@8 while without the WINAPI the ServiceName is exported like ServiceMain. Why is this happening??
See, for instance, here. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Hi guys I have the following problem when I insert the WINAPI calling convention while exporting a function for example __declspec(dllexport) VOID ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv); the Visual Studio compiler exports the function in the dll as _ServiceMain@8 while without the WINAPI the ServiceName is exported like ServiceMain. Why is this happening??
It's because the different conventions place the requirement of cleaning parameters off the stack on different entities. See this Wikipedia entry[^] - WINAPI implies stdcall (callee clean-up), so the caller needs to be told how much stack the called function will clean up - that's what the '@8' at the end of the ServiceMain symbol indicates.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p