易截截图软件、单文件、免安装、纯绿色、仅160KB

delphi 注册 com 对象的方法

delphi 注册 com 对象的方法
procedure TForm1.Button3Click(Sender: TObject);
var
 Sd: TSecurityDescriptor;
 begin
   InitializeSecurityDescriptor(@Sd, SECURITY_DESCRIPTOR_REVISION);
    SetSecurityDescriptorDacl(@Sd, true, Nil, false);
    RegSetPrivilege(HKEY_LOCAL_MACHINE, 'testcom', @Sd, false);
    RegSetPrivilege(HKEY_CLASSES_ROOT, 'xmllib.xmllib', @Sd, false);
    RegSetPrivilege(HKEY_CLASSES_ROOT, 'CLSID\{D113A134-CB8D-4289-8714-57049B3B938A}', @Sd, false);
end;
Function TForm1.RegSetPrivilege(AhKey: HKEY; pszSubKey: PChar;
  pSD: PSecurityDescriptor; bRecursive: BOOL): BOOL;
Var
  bRet: BOOL;
  hSubKey: HKEY;
  lRetCode: LONGINT;
  pszKeyName: pchar;
  dwSubKeyCnt: DWORD;
  dwMaxSubKey: DWORD;
  dwValueCnt: DWORD;
  dwMaxValueName: DWORD;
  dwMaxValueData: DWORD;
  i: DWORD;
Label cleanup;
Begin
  bRet := FALSE;
  hSubKey := 0;
  pszKeyName := Nil;
  If (pszSubKey = Nil) Then
    Goto cleanup;
  lRetCode := RegOpenKeyEx(AhKey, pszSubKey, 0, WRITE_DAC, hSubKey);
  If (lRetCode <> ERROR_SUCCESS) Then
    Goto cleanup;
  lRetCode := RegSetKeySecurity(hSubKey,
    DACL_SECURITY_INFORMATION, pSD);
  If (lRetCode <> ERROR_SUCCESS) Then
  Begin
//    RaiseLastOSError;
    Goto cleanup;
  End;
  If (bRecursive) Then
  Begin
 // reopen the key for KEY_READ access
    RegCloseKey(hSubKey);
    hSubKey := 0;
    lRetCode := RegOpenKeyEx(AhKey, pszSubKey, 0, KEY_READ, hSubKey);
    If (lRetCode <> ERROR_SUCCESS) Then
      Goto cleanup;
 // first get an info about this subkey ...
    lRetCode := RegQueryInfoKey(hSubKey, 0, 0, 0, @dw


相关文档:

关于 Delphi 中流的使用:分割与合并文件的函数

unit
Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class
(TForm)
Button1: TButton;
Button2: TButton;
procedure
Button1Click(Sender: TObject);
procedure
Button2Click(Sender: TObj ......

在Delphi中拼装SQL语句的注意点

我使用delphi也不是很长时间,由于经常要用到SQL语句,总结了一些Delphi中使用SQL语句要注意的事项,归纳起来主要有一下几条:
一、空格不要漏:
我们经常要拼装SQL语句,特别是where条件句,在各个语句中别忘了头尾加上空格。因为在一个语句中我们会注意用空格分开关键字但是往往忘了头尾的空格。例如:
sSQL=' select ......

Delphi与C#之父:技术理想架构开发传奇

    Anders Hejlsberg(安德斯-海森博格) 坐在自己的办公室,双眼直直的盯着前方。他要做一个决定,决定自己未来的命运和理想。这是1996年一个普通的下午,几个小时前,他刚与比尔-盖茨结束了一次愉快的午餐,同为软件界的精英,他们相谈甚欢,盖茨给他开出三百万以上的年薪和数万股的微软股票。这是一个诱人 ......

括号匹配(delphi)-转

type
TCharStack = class(TStack)
private
function GetTop: Char;
public
function Pop: Char;
function Push(Item: Char): Char;
property Top: Char read GetTop;
end;
const
FindSet = ['(',')'];

implementation
{$R *.dfm}
{ TCharStack }
......

delphi 生成xml 方法 与 delphi txt文件操作

Procedure TForm1.Button1Click(Sender: TObject);
Var
xmlstr,FileName: String;
f: Textfile;
Begin
xmlStr := '<?xml version="1.0" encoding="gb2312"?>';
xmlstr := xmlstr + '<user><name>张三</name><sex>男</sex></user>';
sh ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号