export.h
#pragma once
#ifndef EXPORT
# define EXPORT(rettype) __declspec( dllexport ) rettype __cdecl
#endif
***.cpp
#include "export.h"
#ifdef __cplusplus
extern "C" {
#endif
EXPORT(int) export1(void* handle) {
try {
return 0;
} catch (std::exception& e) {
}
return -1;
}
#ifdef __cplusplus
}
#endif