C++中动态加载Dll文件; #include <iostream> #include <windows.h> using namespace std; typedef int (*FunPtr)(int a,int b); int main() { cout << "Hello world!" << endl; FunPtr funptr; HINSTANCE h = LoadLibrary("M://study//20110316//ServerTime//bin//Debug//ServerTime.dll"); funptr = (FunPtr)GetProcAddress(h,TEXT("Add")); int i; i = funptr(10,3); cout << i << endl; FreeLibrary(h); //system("pause"); return 0; }