哪个可以给个调用外部dll文件的源码,第一次用--学习中 哪个可以给个调用外部dll文件的源码,第一次用 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这是DLL代码:library AllPublic;uses Messages, SysUtils, Forms, Classes, Controls, Dialogs, Inifiles;type AFormInfo=array[0..4] of integer;{$R *.res}function GetNextId(Id: string): pchar;stdcall;//=====Get a next number=================////=====Input value : starnumber =======////=====return value: Nextnumber =======////=====Write by : BaoQiongLin=======////=====Date : 2003/12/07 =======//var Int_len : Integer; Int_pos : Integer; Str_value: String ; Int_char : Integer; Next_flag : Boolean; pos2 : Integer;begin Int_pos:=0; pos2:=0; Int_len:=Length(Id); Str_value:=''; //return value Next_flag:=true; repeat Int_char:=Ord(Id[Int_len-Int_pos]); if Next_flag then begin Next_flag:=false; Int_char:=Int_char+1; If Int_char<48 then begin Int_char:=48; end else begin if Int_char>57 then begin Int_char:=48; Next_flag:=true; pos2:=pos2+1; end; end; end; Str_value:=chr(Int_char)+Str_value; Int_pos:=Int_pos+1; Until Int_pos>Int_len-1; if Pos2=Int_pos then Str_value:='A' + Str_value; GetNextId:=Pchar(Str_value);end;exports GetNextId,beginend.下面是调用方法:function GetNextId(Id: string): pchar;stdcall; external 'AllPublic.dll';然后在程序中加入 GetNextID(Str)即可 implementation{$R *.dfm}function GetDiskSER():string;stdcall;external 'F:\EIMS\stoff\1\diskser.dll';procedure TForm1.Button1Click(Sender: TObject);begin showmessage(GetDiskSER());end;end.上面运行进出错在PB里可调用的FUNCTION string GetDiskSER() LIBRARY "diskser.dll" 求助老鸟们,能编译,但取不到数据. 帮个忙 怎么在程序里判断Image控件有没有加载图片? 请教:这样的报表怎么做?我用fastreport 断开TADOConnection 关于打包的问题,高分在线等待......(我们老板老说我没用,可我真不知道怎么办?) 关于SQL SERVER2000 C/S结构客户端访问服务器端数据的问题 將字符轉成ASCII是哪一個函数??? 请问大家有没有"delphi数据库系统开发案例精选"的光盘提供下载?? Delphi 2007在win7任务栏出现两个状态,但是进程里只有一个bds.exe 求购餐饮收银系统原代码!!!急急急 如何快速操作『大文件流』
library AllPublic;uses
Messages,
SysUtils,
Forms,
Classes,
Controls,
Dialogs,
Inifiles;type
AFormInfo=array[0..4] of integer;{$R *.res}function GetNextId(Id: string): pchar;stdcall;
//=====Get a next number=================//
//=====Input value : starnumber =======//
//=====return value: Nextnumber =======//
//=====Write by : BaoQiongLin=======//
//=====Date : 2003/12/07 =======//
var
Int_len : Integer;
Int_pos : Integer;
Str_value: String ;
Int_char : Integer;
Next_flag : Boolean;
pos2 : Integer;
begin
Int_pos:=0;
pos2:=0;
Int_len:=Length(Id);
Str_value:=''; //return value
Next_flag:=true;
repeat
Int_char:=Ord(Id[Int_len-Int_pos]);
if Next_flag then
begin
Next_flag:=false;
Int_char:=Int_char+1;
If Int_char<48 then
begin
Int_char:=48;
end
else
begin
if Int_char>57 then
begin
Int_char:=48;
Next_flag:=true;
pos2:=pos2+1;
end;
end;
end;
Str_value:=chr(Int_char)+Str_value;
Int_pos:=Int_pos+1;
Until Int_pos>Int_len-1;
if Pos2=Int_pos then
Str_value:='A' + Str_value;
GetNextId:=Pchar(Str_value);
end;
exports
GetNextId,
beginend.下面是调用方法:function GetNextId(Id: string): pchar;stdcall;
external 'AllPublic.dll';然后在程序中加入 GetNextID(Str)即可
begin
showmessage(GetDiskSER());
end;end.上面运行进出错
在PB里可调用的
FUNCTION string GetDiskSER() LIBRARY "diskser.dll"