我的dll文件代码如下:
library mydll;{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
procedure val();stdcall;export;
begin
Form1:=TForm1.create(nil);
Form1.Show;
form1.edt1.Text:='hello';
Form1.Font.Color:=clRed;
end;
exports
val;
begin
end.
程序虽然可以运行,但单击按钮后,是重新建立了一个窗体,在文本框里显示红色hello。
我想单击按钮后,在主程序窗体上显示应该怎样做?
library mydll;{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
procedure val();stdcall;export;
begin
Form1:=TForm1.create(nil);
Form1.Show;
form1.edt1.Text:='hello';
Form1.Font.Color:=clRed;
end;
exports
val;
begin
end.
程序虽然可以运行,但单击按钮后,是重新建立了一个窗体,在文本框里显示红色hello。
我想单击按钮后,在主程序窗体上显示应该怎样做?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货