欲在。EXE 中调用PRO.DLL
PRO.DLL中函数如:
long MenuExecute( char *, long , HWND , long , char *, long , void * );
在.EXE端程序:
HINSTANCE hPro= ::LoadLibrary("Pro.dll");
if(hPro == NULL)
{
return;
}
else
{
typedef long (*MENU_EXECUTE)( char *, long , HWND , long , char *, long , void * );
MENU_EXECUTE mebu = NULL;
mebu=(MENU_EXECUTE)::GetProcAddress(hPro, "MenuExecute");//MenuExecute 函数名字
if(mebu)
{
mebu(szMdbDir,
0L,
AfxGetApp()->m_pMainWnd->GetSafeHwnd(),
MENU_ID,
NULL,
0L,
NULL); //执行DLL中相应函数
}
::FreeLibrary(hPro);
}
时间: 2024-09-28 11:24:27