求高手把这个验证码ocr.DLL Delphi调用代码声明部分转换成vb的。。。
本帖最后由 ftlsisme 于 2011-05-15 12:31:18 编辑
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
procedure IMG2BMP(filename : PChar); Stdcall;external 'E:\down\advocr\AdvOCR.dll' name 'IMG2BMP';
function OcrInit : boolean; Stdcall;external 'E:\down\advocr\AdvOCR.dll' name 'OcrInit';
procedure OcrDone; Stdcall;external 'E:\down\advocr\AdvOCR.dll' name 'OcrDone';
function OCR_C(OCR_type,filename : PChar): PChar; Stdcall;external 'E:\down\advocr\AdvOCR.dll' name 'OCR_C';
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
a,b,c,d:string;
begin
a:='f:\q.jpg';
b:='f:\q.bmp';
c:='163_esales';
// IMG2BMP(PChar(a));
d:= StrPas(OCR_C('163_esales',PChar(b)));
memo1.Text:='证码识别值:' d;
end;
end.
才学调用dll,这个IMG2BMP(PChar(a));好像能成功。而ocr_c就没反应了,我找了别人一源程序,反复看都差不多。别人的有效果。而我的不行,这是为什么?我这样弄是正确的吗?烦请指点,谢谢了~~~
贴子来源飞诺网(http://bbs.firnow.com) 详细出处参考:http://bbs.firnow.com/dview61t15478.html