本人是个初学者,请教一个关于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.
我在一个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.
解决方案 »
- delphi ctrl+空格问题
- 大虾们进来帮指点一下关于Tchart的
- 读文件时,统计行数,为何比实际的多一行
- 急!急!急!Delphi的联机帮助文档怎么做?在线等......
- 用ADO调用Oracle的存储过程,传递RAW或BLOB类型用什么参数类型?
- 关于在 简体 系统下 开发 使用 BIG5 编码系统 的程序 的问题!!!!!!!!!!!!
- 在一个窗体上如何用上下箭头键控制焦点的移动????
- 请问如何改变 delphi ——.EXE文件的默认图标?
- 非常奇怪的现象。。。
- Ado中怎样控制只生成一条INSERT语句
- 请教:我在局域网内,网关是一台路由器,我如何获得它的外网IP?(急)
- 请问这个 qtintf70.dll 是干什么的?
function getstringword(stringword:string):boolean;far;external 'dllverify.dll';
中的getstringword(stringword:string)改成GetStringWord(StringWord:string)
试试
标识符完全一致(尽管DELPHI本身大小写不敏感)。