Dll_handle=LoadLibrary("...\...\...\Mydll.dll");//dll文件的路径 if(Dll_handle==NULL) { AfxMessageBox("dll has not be loaded !"); return; } DllTest=(DLLTEST)GetProcAddress(Dll_handle,"DllTest"); if(DllTest==NULL) { AfxMessageBox("dll function has not be loaded !"); return; } AfxMessageBox("begin to use function"); DllTest(); AfxMessageBox("end of use function"); FreeLibrary(Dll_handle);