#include<Windows.h> #include<iostream> using namespace std; typedef int(*Dllfun)(int , int); void main() { Dllfun f; HINSTANCE hdll; hdll = LoadLibrary("MyDll.dll"); if (hdll == NULL) { FreeLibrary(hdll); } f = (Dllfun)GetProcAddress(hdll, "Add"); if (f == NULL) { FreeLibrary(hdll); } cout << f(1,9); FreeLibrary(hdll); system("pause"); }