【已解决】有个dll,有c++调用例子,求AU3调用例子。
本帖最后由 netsmu 于 2011-6-16 16:51 编辑// Sunday.dll演示程序。
//
#include <iostream>
#include <Windows.h>
int main()
{
HINSTANCE hInst = LoadLibraryA("Sunday.dll");//载入Sunday.dll
if (!hInst)
{
std::cout<<"无法加载 Sunday.dll!";
getchar();
return 0;
}
//-----------LoadCdsFromFile------------
typedef int (CALLBACK* LPLoadCds)(char[]);
LPLoadCds LoadCdsFromFile = (LPLoadCds)GetProcAddress(hInst, "LoadCdsFromFile");
int index = LoadCdsFromFile ("yzm");//载入识别库
if (index == -1)//返回-1说明载入识别库出错
{
std::cout<<"载入识别库出错。";
getchar();
return 0;
}
//-----------GetVcodeFromFile------------
typedef bool (CALLBACK* LPGetVcode)(int,char[],char[]);
LPGetVcode GetVcodeFromFile = (LPGetVcode)GetProcAddress(hInst, "GetVcodeFromFile");
char result;//定义一个字符串以接受验证码,这里验证码字符数是4,所以取5.
if (GetVcodeFromFile(index,"1.jpg",result))
std::cout<<"验证码识别成功:"<<result;
else
std::cout<<"验证码识别失败!";
getchar();
return 0;
}
这个是c++调用dll的例子,求au3调用这个dll的函数,谢谢啦。 $dll = DllOpen("Sunday.dll")
$aa = dllcall($dll,"int","LoadCdsFromFile","str","yzm")
$bb = ''
$disn = dllcall($dll,"BOOL","GetVcodeFromFile","int",$aa,"str","1.jpg","str",$bb)
MsgBox(0,$disn,$disn)
搞定了,谢谢各位。 呵呵,有好东西就推荐给大家公用吧 不是什么好东西啦,这个是请别人制作的,也就只能识别特制的验证码,其他验证码识别不了,而且不是我做的,所以不方便公开,抱歉了。
页:
[1]