小弟今天看书,关于窗口重调用的问题,自己也动手也编了一个简单的例子,来练练手,但是老是编译不过去,不知道是什么原因,请求大家的帮助,项目文件如下;
library project1;uses
Forms,
Unit1 in 'Unit1.pas' {Form1};exports
addstr;{$R *.res}begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
就下来就是unit1了,如下:unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
procedure addstr;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation
{$R *.dfm}procedure Tform1.addstr;
var s:string;
begin
s:=inputbox('put','please input','');
memo1.Lines.Append(s); end;procedure TForm1.Button1Click(Sender: TObject);
begin
addstr;
end;end.
编译的时候,项目文件提示,不知道addstr是什么,希望大家帮我看看,告诉我,谢谢了。
library project1;uses
Forms,
Unit1 in 'Unit1.pas' {Form1};exports
addstr;{$R *.res}begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
就下来就是unit1了,如下:unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
procedure addstr;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation
{$R *.dfm}procedure Tform1.addstr;
var s:string;
begin
s:=inputbox('put','please input','');
memo1.Lines.Append(s); end;procedure TForm1.Button1Click(Sender: TObject);
begin
addstr;
end;end.
编译的时候,项目文件提示,不知道addstr是什么,希望大家帮我看看,告诉我,谢谢了。
解决方案 »
- 液晶显示器下,怎样配色IDE以使开发效率最大化?
- Delphi生成的 EXE 或者 DLL 文件很大,怎样对他们来进行压缩,使EXE、DLL的大小变的小一点。请指点
- Please help me???? Query与SQL的参数传递
- 急呀!union问题,高手指点,谢谢!
- 商业逻辑(业务逻辑)具体是什么东西?
- 快过年了,散分庆祝!
- 如何看编译好得DELPHI程序界面上用了什么VCL控件
- 国庆节快到了,出来 散分!!!来哟.....................
- 如果我的AdoDataSet是打開狀態, 我就不需要再打開一次,否則就打開,怎麼判斷?謝謝~
- 怎样去掉字符串两端的空格
- find函数的问题,请各位老兄帮忙
- bde administrator 如何卸载?
begin
//Application.Initialize; 统统去掉
//Application.CreateForm(TForm1, Form1);
//Application.Run;
end.interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
//procedure addstr; 改成全局过程
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation
{$R *.dfm}procedure addstr; stdcall;
var s:string;
Form1: TForm1;
begin
try
Form1 := TForm1.Create(Application);
Form1.ShowModal;
s:=inputbox('put','please input','');
Form.memo1.Lines.Append(s);
finally
FreeAndNil(Form1);
end;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
addstr;
end;end.
编译的时候,项目文件提示,不知道addstr是什么,希望大家帮我看看,告诉我,谢谢了。
和exe是不同的