Rieccomi...
preferisco fare un collegamento esplicito, altrimenti mi tocca portarmi dietro oltre all'exe ed alla dll altri file, o sbaglio?
ho aggiornato il codice seguendo l'esempio di msdn
ma quando mi arriva ad eseguire la funzione mi da un errore.codice:#include <iostream.h> #include <windows.h> typedef UINT (CALLBACK* LPFNDLLFUNC1)(INT,INT); void main() { HINSTANCE hDLL; // Handle to DLL LPFNDLLFUNC1 lpfnDllFunc1; // Function pointer INT uReturnVal; hDLL = LoadLibrary("C:\\DLL\\Debug\\DLL.dll"); cout<<"Handle = "<<hDLL<<"\n"; if (hDLL != NULL) { lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL, "Somma"); if (!lpfnDllFunc1) { // handle the error FreeLibrary(hDLL); MessageBox(0,"ERROR: Funzione non trovata","ERROR",MB_OK); exit(0); } else { // call the function uReturnVal = lpfnDllFunc1(1, 2); } } else MessageBox(0,"FATAL ERROR: DLL NON CARICATA","FATAL ERROR",MB_ICONSTOP); }
Eccoti una foto dell'errore
Grazie ancora.


Rispondi quotando