参数是OleVariant,怎么处理?

wangbab wangbab 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
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;
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部