#include #include typedef int (__stdcall *f_funci)(); int initdll(); int main () { if ( initdll() == 1 ) { printf( "Server started!\n" ); } else { printf( "DLL not found\n" ); return 0; } while ( 1 == 1 ) { //printf( "..." ); // preform other dll releted actions } } int initdll() { double a = 1; double b = 2; HINSTANCE hInst = LoadLibrary("C:\\dev\\teste\\DLLExportTest.dll"); if( hInst != NULL ) { f_funci funci = (f_funci)GetProcAddress(hInst, "Add"); if (!funci) { printf( "could not locate the function\n" ); return EXIT_FAILURE; } else { funci(&result); } FreeLibrary( hInst ); // temporary return 1; } else { return 0; } }