I
iseeks1
Unregistered / Unconfirmed
GUEST, unregistred user!
现用delphi调用vc编写的一个动态连接库中的函数,函数接口说明如下:
语法:int SEH_InitialSession(HSE *hSE, unsigned short a,char *b,char *c,unsigned long d,unsigned short e,char *f,char *g )
参数说明:
参数名 含义 输入/输出 参数选项
hSE 函数句柄#define void* HSE Out
a 设备类型 In 2为文件
... ... ... ...
请问如何给出相应的delphi类型?然后对于输出的*hSE如何获取?我的程序如下(???处为疑惑点):
unit normal_in1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
//??????下一句将VC动态链接库内的函数转为delphi声明
function SEH_InitialSession(out hSE: Pointer;a: Integer;const b: WideString;
const c: WideString;
d: Integer;
e: Integer;
const f: WideString;
const g: WideString):Integer;StdCall;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
protected
//??????
myhSEointer;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
//??????下一句是调用dll说明
function SEH_InitialSession;external 'SafeEngine.dll' name 'SEH_InitialSession';
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
//??????下一句中的myhSE可否直接这样作为参数,然后怎样获取这个输出值
label2.Caption:=inttostr(SEH_InitialSession(myhSE,2,'C:/userkey.key','lala',1000,2,'C:/CertChain.spc',''));
end;
end.
语法:int SEH_InitialSession(HSE *hSE, unsigned short a,char *b,char *c,unsigned long d,unsigned short e,char *f,char *g )
参数说明:
参数名 含义 输入/输出 参数选项
hSE 函数句柄#define void* HSE Out
a 设备类型 In 2为文件
... ... ... ...
请问如何给出相应的delphi类型?然后对于输出的*hSE如何获取?我的程序如下(???处为疑惑点):
unit normal_in1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
//??????下一句将VC动态链接库内的函数转为delphi声明
function SEH_InitialSession(out hSE: Pointer;a: Integer;const b: WideString;
const c: WideString;
d: Integer;
e: Integer;
const f: WideString;
const g: WideString):Integer;StdCall;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
protected
//??????
myhSEointer;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
//??????下一句是调用dll说明
function SEH_InitialSession;external 'SafeEngine.dll' name 'SEH_InitialSession';
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
//??????下一句中的myhSE可否直接这样作为参数,然后怎样获取这个输出值
label2.Caption:=inttostr(SEH_InitialSession(myhSE,2,'C:/userkey.key','lala',1000,2,'C:/CertChain.spc',''));
end;
end.