unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
//在这里定义implementation{$R *.DFM}end.然后在其它form中uses unit1就可以使用你定义的变量 如果调用dll
function DisableMouseHook:Boolean; stdcall; external 'Project1.dll' name 'DisableMouseHook';调用project1.dll中的disablemousehook过程。
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
//在这里定义implementation{$R *.DFM}end.然后在其它form中uses unit1就可以使用你定义的变量 如果调用dll
function DisableMouseHook:Boolean; stdcall; external 'Project1.dll' name 'DisableMouseHook';调用project1.dll中的disablemousehook过程。
解决方案 »
- DELPHI的那个设置属性的控件名叫什么
- 请教,如何去掉默认的登陆框?急急急!
- 急!!! delphi7中作报表的控件在哪? 各位高手帮忙, 在线等待!!!
- 没分了,最后40分提2个问题,大家帮帮忙
- 怎么才能把adoquery的结果输入到STRINGGRID或DBGRID都行。然后可以选择字段打印出来?最好有DEMO
- 在XP下,好象ADO有时候会有问题?比如在事务处理时,我的程序总是出错
- 有谁搞过网络互联的工作,进来看看?
- 100分唾手可得
- 如何让dataset中的内容在dbgrid中以另一个内容显示
- 分数用不了,给大家一些!3
- 用MDI application时,遇到问题了
- 在一个treeview的节点中,怎么设置每个字的颜色,各位大哥,谢谢了
你誤會我的意思了,我是說在開發Dll時怎樣在Dll內部定義一個全局變量.供該dll內部的function調用.所說的function問題也是這樣
unit XXXXXX;
interface
uses
Windows, Messages, SysUtils, Controls, StdCtrls;
type
.....
var
声明全局变量;
function .......
当然这是在dll中use了另外一个unit,如果就在那个dll中写也是一样的。
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
SysUtils,
Classes;var
//定义变量就可以用
{$R *.RES}begin
end.
你把过程也在另一个单元,然后在implementation前面声明一下。