procedure OpenStream(var vVideoPort: OleVariant; var vPciPort: OleVariant; bMinimized: Integer;
var nRetVal: SYSINT); safecall;
是引入的一个COM接口下的方法。
参数vVideoPort应该传一个record的的值。该Record的定义如下。VRECT = packed record
nStartX: Integer;
nStartY: Integer;
nWidth: Integer;
nHeight: Integer;
end;VelaPciPort = packed record
nFormat: VideoFormat;
nStreamType: VideoType;
nPitch: SYSINT; //integer
bVanityMode: Integer;
bUseMMU: Integer;
dwAddr: Integer;
nStreamRate: SYSINT;
pReserved0: Integer;
pReserved1: Integer;
VRECT: VRECT;
end;VelaVideoPort = packed record
nPort: VideoPort;
nFrameRate: SYSINT;
FieldCtl: VelaFieldCtl;
VAcqRect: VRECT;
end;下面是我的调用代码
var
tempVideoPort:VelaVideoPort;
tempPciPort:VelaPciPort;
begin
...//初始化tempPort,tempPciPort;;
Self.m_CVProServer.OpenStream(tempVideoPort,tempPciPort,0,nRetVal);
//但是编译报错。错误提示是Invalid typecast.
//到底怎么才能把一个Record传进去??
end;
var nRetVal: SYSINT); safecall;
是引入的一个COM接口下的方法。
参数vVideoPort应该传一个record的的值。该Record的定义如下。VRECT = packed record
nStartX: Integer;
nStartY: Integer;
nWidth: Integer;
nHeight: Integer;
end;VelaPciPort = packed record
nFormat: VideoFormat;
nStreamType: VideoType;
nPitch: SYSINT; //integer
bVanityMode: Integer;
bUseMMU: Integer;
dwAddr: Integer;
nStreamRate: SYSINT;
pReserved0: Integer;
pReserved1: Integer;
VRECT: VRECT;
end;VelaVideoPort = packed record
nPort: VideoPort;
nFrameRate: SYSINT;
FieldCtl: VelaFieldCtl;
VAcqRect: VRECT;
end;下面是我的调用代码
var
tempVideoPort:VelaVideoPort;
tempPciPort:VelaPciPort;
begin
...//初始化tempPort,tempPciPort;;
Self.m_CVProServer.OpenStream(tempVideoPort,tempPciPort,0,nRetVal);
//但是编译报错。错误提示是Invalid typecast.
//到底怎么才能把一个Record传进去??
end;
解决方案 »
- 如何让程序自己覆盖自己!并且在覆盖后再自动运行?
- 请问在quickrep报表中如何将一个浮点型数字用百分数来表示?
- 程序中多处需要用到高级查询,代码如何封装好?
- 请高手帮忙找一下,谢谢!
- 请问哪里有"Object Pascal Language Guide "的中文版下载?急用!!
- 求 InstallShield 7 Developer!!!150 分!
- 请问文本的不可逆加解密的现成算法下载或是控件dll下载?
- 谁能提供日期时间类型的editmask(2002-01-01 22:14)
- 请问TNMPOP3?
- 如何在delphi中执行dos命令?
- 怎么从注册表里面获得机器的mac地址?
- [FAQ] Modem连接创建后,从COM中读取,总是会首先读到某个字符,为什么?解决问题后加到100分
TTest = packed record
a, b, c, d: Integer;
e, f: array[0..127] of Char;
end;procedure Example;
var
test: TTest;
p: Integer;
v: Variant;
begin
//为test填值
//...
//... // 将test中的内容传给v
v := VarArrayCreate([0,sizeof(test)-1], varByte);
p := VarArrayLock(v);
try
Move(test, p^, sizeof(test));
finally
VarArrayUnlock(v);
end; // 调用接口方法
MyInterfaceObject.MyMethod(v);
end;