1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#include <stdio.h> #include <windows.h> #ifdef __cplusplus extern "C" { #endif #include <time.h> __declspec(dllexport) char *get_time() { time_t ltime; time(<ime); return ctime(<ime); } __declspec(dllexport) void say_hello(char *message) { printf("Hello from dll!\n%s", message); } #ifdef __cplusplus } #endif