一般的unit代码中是uses后面是type语句,type语句都是窗体中的组件的定义,我写的是dll,只是一个被调用的函数,也没有窗体,没有组件,type语句一个写些什么呢?
还有我写好的代码怎么有错误呢,好像系统根本不识别我写的东西,好像无法进入我写的函数似的呢?
这是我的代码,大家帮我看看百.
uses
ShareMem,
SysUtils,
Classes;{$R *.res}procedure SetPoint(x, y : Integer; s : PChar) StdCall; Exports SetPoint;Var
tr : TRect;
DrawStyle: DWORD;
begin
DrawStyle := DrawStyle or DT_WORDBREAK or DT_EDITCONTROL
or DT_EXPANDTABS or DT_NOPREFIX;
tr.left := x;
tr.top := y;
//Windows.DrawText(Canvas.Handle,PChar(s),Length(s),tr,DrawStyle);
end;
还有我写好的代码怎么有错误呢,好像系统根本不识别我写的东西,好像无法进入我写的函数似的呢?
这是我的代码,大家帮我看看百.
uses
ShareMem,
SysUtils,
Classes;{$R *.res}procedure SetPoint(x, y : Integer; s : PChar) StdCall; Exports SetPoint;Var
tr : TRect;
DrawStyle: DWORD;
begin
DrawStyle := DrawStyle or DT_WORDBREAK or DT_EDITCONTROL
or DT_EXPANDTABS or DT_NOPREFIX;
tr.left := x;
tr.top := y;
//Windows.DrawText(Canvas.Handle,PChar(s),Length(s),tr,DrawStyle);
end;
解决方案 »
- DBGridEh中增加checkbox列
- 数据库中两张数据表的值运算问题
- 身体力行 带头散分----致QQ群5093957中一群郁闷的人
- 有没有地方下载一个Shape控件,它必须含有右键功能和双击功能
- 装了Delphi7后怎么系统命令失灵了??
- Delphi操作Excel的问题,望大牛们指教!
- 怎么控制点歌系统的音量!如增大音量,减小音量.我用的是神龙卡,我用waveoutsetvolume不起作用。
- ★★★100分求mmtools控件(带源代码),请各位大侠帮忙[email protected]
- delphi如何编程操作access2007附件字段里面的内容
- 有关SQL问题,应该怎么改才能使用!
- 控件
- 怎样从flash中发送消息到delphi中??
/*-------仅供参考---------*/library wei_soft;{ 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
SysUtils,
Classes;{$R *.res}
{*** CRC位校验 ***
函数名: CRC
参 数: data 被校验的字符,
crcbuf 预设值
返回值:无
功 能:对16进制的某一位进行校验
注:本函数应由其它CRC 函数调用,不应该由程序员直接调用.}
procedure CRC(data:byte;var crcbuf:word);stdcall;
var
i:integer;
last:byte;
begin
crcbuf:=crcbuf xor data;
for i:=1 to 8 do
begin
last:=crcbuf and $01;
crcbuf:= crcbuf shr 1;
if last=$01 then crcbuf:=crcbuf xor $A001 ;
end;
end;{*** CRC校验函数 ***
函数名: CRCJiaoYan
参 数: a,b,c,d,e,f 被校验的6个字节位
返回值:无
功 能:对16进制数进行CRC校验
注:在intel芯片组中,得到的高位,低位是相反的。}
Function CRCJiaoYan(const a,b,c,d,e,f:byte):word;stdcall;
var
crcbuf:word;
Num:array[0..5] of byte;
i:integer;
begin
crcbuf:=$ffff;
num[0]:=a;
num[1]:=b;
num[2]:=c;
num[3]:=d;
num[4]:=e;
num[5]:=f;
for i:=0 to 5 do
CRC(Num[i],crcbuf);
CRCJiaoYan:=crcbuf;
end;exports
CRC,
CRCJiaoYan;
beginend.