#include <windows.h> #include <stdio.h> 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.d +ll"); 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; } }
In reply to Re^2: Import a DLL from C# to Perl
by paulorfmmb
in thread Import a DLL from C# to Perl
by paulorfmmb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |