Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

Export C++ Functions for Use in C-Language Executables

Visual Studio 6.0

http://msdn.microsoft.com/en-us/library/aa240996(v=vs.60).aspxOverviewHow Do IFAQDetailsSample

If you have functions in a DLL written in C++ that you want to access from a C-language module, you should declare these functions with C linkage instead of C++ linkage. Unless otherwise specified, the C++ compiler uses C++ type-safe naming (also known as name decoration) and C++ calling conventions, which can be difficult to call from C.

To specify C linkage, specify extern "C" for your function declarations. For example:

extern "C" __declspec( dllexport ) int MyFunc(long parm1);

What do you want to do?

What do you want to know more about?

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.