http://void CCallDllDlg::FindBmp()
{
int cx,cy;//找到图片的横坐标cx和纵坐标cy
CString temp_x,temp_y;//
CString msg="a.bmp";//要查找的bmp文件(24位色位图)
HINSTANCE hDllInst = LoadLibrary("FindPic.dll");
if(hDllInst)
{
typedef void (*MYFUNC)(CString,int*,int*);
MYFUNC youFuntionNameAlias = NULL; // youFuntionNameAlias 函数别名
youFuntionNameAlias = (MYFUNC)GetProcAddress(hDllInst,"FindPic");
// youFuntionName 在DLL中声明的函数名
if(youFuntionNameAlias)
{
youFuntionNameAlias(msg,&cx,&cy);
temp_x.Format("%d",cx);
temp_y.Format("%d",cy);
AfxMessageBox("横坐标"+temp_x+" 纵坐标"+temp_y);
SetCursorPos(cx,cy);//移动鼠标到图片位置
}
FreeLibrary(hDllInst);
}
}