Convert __declspec to _export C++
I am converting the following function. But the n开发者_StackOverflowew converted function is not executed. Any ideas?
Old Function
extern "C" DWORD __declspec(dllexport) FAR MyFunc (char *value1, int *value2)New Function
extern "C" DWORD _export FAR MyFunc (char *value1, int *value2)_export is obsolete in the newer versions of Visual C++, see here.
Let me cite this article: It is not possible to maintain a single source for 16-bit and 32-bit code by simply replacing __export with _declspec() because _declspec() is a storage class modifier and __export is a type modifier. The article states, that _export only works for 16-bit programs. So you should actually produce a 16-bit program and DLL.
精彩评论