急,关于COM安全数组的使用psafearray??? ( 积分: 100 )

  • 主题发起人 主题发起人 net407
  • 开始时间 开始时间
N

net407

Unregistered / Unconfirmed
GUEST, unregistred user!
用DELPHI制作VC++ COM客户端:

procedure SetReadBuffer(size: SYSINT; filter: SYSINT); safecall;

调用此函数已成功申请4K内存

问题:
function Read(maxsize: SYSINT; var data: PSafeArray): SYSINT; safecall;

调用此函数时,怎么使用psafearray ,如何申明data?如何读取psafearray 数据??
在ActiveX.pas里psafearray如下:
TSafeArrayBound = tagSAFEARRAYBOUND;
{$EXTERNALSYM SAFEARRAYBOUND}
SAFEARRAYBOUND = TSafeArrayBound;

PSafeArray = ^TSafeArray;
{$EXTERNALSYM tagSAFEARRAY}
tagSAFEARRAY = record
cDims: Word;
fFeatures: Word;
cbElements: Longint;
cLocks: Longint;
pvData: Pointer;
rgsabound: array[0..0] of TSafeArrayBound;



已经两星期无果了……
劳驾!
 
用DELPHI制作VC++ COM客户端:

procedure SetReadBuffer(size: SYSINT; filter: SYSINT); safecall;

调用此函数已成功申请4K内存

问题:
function Read(maxsize: SYSINT; var data: PSafeArray): SYSINT; safecall;

调用此函数时,怎么使用psafearray ,如何申明data?如何读取psafearray 数据??
在ActiveX.pas里psafearray如下:
TSafeArrayBound = tagSAFEARRAYBOUND;
{$EXTERNALSYM SAFEARRAYBOUND}
SAFEARRAYBOUND = TSafeArrayBound;

PSafeArray = ^TSafeArray;
{$EXTERNALSYM tagSAFEARRAY}
tagSAFEARRAY = record
cDims: Word;
fFeatures: Word;
cbElements: Longint;
cLocks: Longint;
pvData: Pointer;
rgsabound: array[0..0] of TSafeArrayBound;



已经两星期无果了……
劳驾!
 
后退
顶部