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
相关文档:
JNI(Java+Native+Interface,Java本地接口)技术大家都不陌生,它可以帮助解决Java访问底层硬件的局限和执行效率的提高。关于JNI的开发,大多数资料讨论的都是如何用C/C++语言开发JNI,甚至于JDK也提供了一个javah工具来自动生成C语言程序框架。但是,对于广大的Delphi程序员来说,难道就不能用自己喜爱的Delphi与Java互通消 ......
Delphi字符串函数大全
uses StrUtils;
【字符串函数大全】
首部 function AnsiResemblesText(const AText, AOther: string): Boolean;
$[StrUtils.pas
功能 返回两个字符串是否相似
  ......
delphi 编写的com 对象 用php调用
的
实例
delphi:
function Tmyxml.Get_xml: WideString;
begin
Get_xml:='wo shi a lei!';
end;
function Tmyxml.Get_xmldata: WideString;
var
xmlStr:string;
begin
xmlStr := '<?xml version="1.0" & ......
delphi 编写的com 对象 用delphi 的调用实例
COM 对象与 前一篇文章的 PHP调用的COM为同一个对象,故不例出COM.
procedure TForm1.Button4Click(Sender: TObject);
var
myCounter, mReturn: variant;
begin
myCounter := CreateOleObject('abc.myxml');
mReturn := myCounter.xml;
&nbs ......
dll 调用方法有 静态调用和动态调用两种方法
用到的dll为上篇文章所编写的dll.
总结如下:
Unit Unit1;
Interface
Uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
Type
TForm1 = Class(TForm)
Button1: TButton; ......