si on crée un projet MFC, l'usage de la dll est relativement simple
ex d'un appel de la fonction
int disconnect(HWND, LPTSTR)
:
BOOL CCoucouDlg::go(const CString&cheminDll)
{
HINSTANCE hDllInst = NULL;
CString strPlg = APP.GetPluginsPath(cheminDll);
hDllInst = GetModuleHandle(strPlg);
if (hDllInst)
{
int rc =-1;
int (*lpfnDisconnect)(HWND, LPTSTR);//proto de la fonction de la DLL
(FARPROC&)lpfnDisconnect =
GetProcAddress(hDllInst, _T("disconnect"));//nom de la fonction
if (lpfnDisconnect)
rc = lpfnDisconnect(m_hWnd, "param specifiques");
}
return (rc == 1);
}
FreeLibrary(hDllInst);
return 0;
}
___________________________________________________________
MagicalementNono 