当前位置:主页>Delphi教程>文章内容
在Delphi中通过函数获取GUID
来源: 作者: 发布时间:2007-04-29  
 

keyword:
 ActiveX, TGUID, CoCreateGUID, GUIDToString

//---Test Program By Conan 2005/04/14---//
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,
  ActiveX, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}


procedure TForm1.Button1Click(Sender: TObject);
var
  I   : Integer;
  sGUID  : string;
  TmpGUID: TGUID;
begin
  for I := 0 to 10 do
  begin
    if CoCreateGUID(TmpGUID) = S_OK then
      sGUID := GUIDToString(TmpGUID)
    else
      ShowMessage('Create GUID error!');
    ShowMessage(sGUID);
  end;
end;

end.



 
上一篇:Oracle中通过存储过程中返回数据集及在Delphi中使用   下一篇:解决无法按y轴显示的问题!
 
  相关文章
·Oracle中通过存储过程中返回数据集及在
·解决无法按y轴显示的问题!
·DBGrid单元格画圆圈
·C\S结构中成批保存CLIENTDATASET中的数
·让窗体在执行了“显示桌面”以后仍旧显
·角点检测算子的代码描述
·将多个jpg文件以追加形式合并成一个文
·扫雷外挂的设计与实现(五)
·模拟delphi编辑窗体操作控件。。。
·PowerBuilder调用Delphi写的Dll时发生
·扫雷外挂的设计与实现(四)
·Delphi下的接口编程学习笔记(原创)
 
【关闭窗口】
推荐本站资源
最新文章