本人是个初学者,请教一个关于DLL的问题。
我在一个dll中包含一个可视的form,通过form来进行一些处理,但是我在应用程序用调用这个dll时,总是提示我“无法定位程序输入点getstringword于动态链接库dllverify.dll上”。下面是程序的全部源码:
dll源码:
library DLLVerify;uses
  fmVerify in 'fmVerify.pas' {frmVerify};{$R *.RES}exports
    GetStringWord;
    
begin
end.form源码:
unit fmVerify;interfaceuses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons;type
  TfrmVerify = class(TForm)
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    Label1: TLabel;
    Edit1: TEdit;
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  frmVerify: TfrmVerify;function GetStringWord(StringWord:string):boolean;export;implementation{$R *.DFM}function GetStringWord(StringWord:string):boolean;
var
    frmVerify:Tfrmverify;
begin
    Result := False;
    try
        frmVerify:=TfrmVerify.Create(application);
        with frmverify do
        if  showmodal =mrok then
            if uppercase(edit1.text)<>uppercase(stringword) then
            showmessage('bu fu!!')
            else
            result:= true;
    finally
        frmverify.Free;
    end;
end;end.
调用dll的应用程序源码:
unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Mask, Buttons;type
  TForm1 = class(TForm)
    BitBtn1: TBitBtn;
    Label1: TLabel;
    Edit1: TEdit;
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.DFM}function getstringword(stringword:string):boolean;far;external 'dllverify.dll';
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
if getstringword(edit1.text) then
label1.Caption := 'ok'
else
label1.Caption := ' no ok';
end;end.