The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!
extern "C" {
bool __stdcall __declspec(dllimport) test(int n, char * input);
}
[DllImport("test.dll", CallingConvention=CallingConvention.Cdecl)]
public static extern bool test(int n, StringBuilder input);
extern "C" {
bool __declspec(dllexport) test(int n, char * input);
}
// header.h
#ifndef HEADER_H
#define HEADER_H
#ifdef __cplusplus
extern "C"
{
#endif
#ifdef TESTDLL_BUILD
#define TESTDLL_EXPORTIMPORT __declspec(dllexport)
#else
#define TESTDLL_EXPORTIMPORT __declspec(dllimport)
#endif
// ...
bool TESTDLL_EXPORTIMPORT test(int n, char * input);
// ...
#ifdef __cplusplus
}
#endif
#endif // HEADER_H
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Join the community of 500,000 technology professionals and ask your questions.