Need your help
-
Hi, In normal DLL, to export a function we place extern "c" __declspec(dllexport) before the funtion prototype. Can any one tell me what this extern "c" indicates and what happens if we don't use extern "c" before __declspec while exporting and importing the function. Thanks in advance.
-
Hi, In normal DLL, to export a function we place extern "c" __declspec(dllexport) before the funtion prototype. Can any one tell me what this extern "c" indicates and what happens if we don't use extern "c" before __declspec while exporting and importing the function. Thanks in advance.
There are various tutorials on net about dll. try to use Google...:) BTW extern "C" is used with __declspec to calling methods from Dll compiled in 'C'. see this link: http://msdn.microsoft.com/en-us/library/ys435b3s(VS.80).aspx[^]
Mukesh Kumar Software Engineer
modified on Saturday, May 10, 2008 1:46 AM
-
Hi, In normal DLL, to export a function we place extern "c" __declspec(dllexport) before the funtion prototype. Can any one tell me what this extern "c" indicates and what happens if we don't use extern "c" before __declspec while exporting and importing the function. Thanks in advance.
extern "C"
makes the function exported using C-like mangling scheme (instead ofC++
one), this is, for instance, the standard forWin32 API
. :)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 -
Hi, In normal DLL, to export a function we place extern "c" __declspec(dllexport) before the funtion prototype. Can any one tell me what this extern "c" indicates and what happens if we don't use extern "c" before __declspec while exporting and importing the function. Thanks in advance.
extern <string literal> specifies the external linkage that its name is visible outside the file in which it is defined, Microsoft C++ supports the strings "C" and "C++" in the string-literal field to specify the linkage convention of other languages, you can link to the function, if the linkage conventions are same.