关于形参和实参不一致的问题
时间:2011-11-24
来源:互联网
var
s: integer ;
begin
s := strtoint(ComboBox8.Text)*32 + strtoint(ComboBox9.Text) ;
if ComboBox8.Text='' then
begin
ShowMessage('Please select Projector ID');
exit;
end;
if not switchchanel_video(s,4,'')//这里报错
then ShowMessage('Divide error');
end;
这个是用来调用DLL的
声明如下
function switchchanel_video(maxinputchannel,maxoutputchannel:integer; var sendstring:pchar):integer;stdcall;
function switchchanel_video;stdcall; external DLLName;
这到底怎么不一致了啊 最后一个参数我要为空
作者: minipig520 发布时间: 2011-11-24
试试?
作者: warrially 发布时间: 2011-11-24
作者: minipig520 发布时间: 2011-11-24
作者: warrially 发布时间: 2011-11-24
procedure TMainForm.Button9Click(Sender: TObject);
var
s: integer ;
tmpp: PChar;
begin
tmpp := PChar('');
s := strtoint(ComboBox8.Text)*32 + strtoint(ComboBox9.Text) ;
if ComboBox8.Text='' then
begin
ShowMessage('Please select Projector ID');
exit;
end;
if not switchchanel_video(s,4,tmpp )
then ShowMessage('Divide error');
end;
作者: csn168 发布时间: 2011-11-24
作者: minipig520 发布时间: 2011-11-24
定义一个临时变量 将它复制为空 然后传这个变量到函数里
procedure TMainForm.Button9Click(Sender: TObject);
var
s: integer ;
tmpp: PChar;
begin
tmpp := PChar('');
s := strtoint(ComboBox8.Text)*32 + strtoint(Combo……
[ERROR]typeexpression must be BOLLEAN 错误指向showmessage
[Fatal Error] Could not compile used unit 'BD100TEST.pas'
作者: minipig520 发布时间: 2011-11-24
var
s,ret: integer ;
temp : PChar;
begin
temp := PChar('') ;
s := strtoint(ComboBox8.Text)*32 + strtoint(ComboBox9.Text) ;
if ComboBox8.Text='' then
begin
ShowMessage('Please select Projector ID');
exit;
end;
if ComboBox9.Text='' then
begin
ShowMessage('Please select Projector ID');
exit;
end;
ret := switchchanel_video(s,4,temp);
if ret = 0
then ShowMessage('Divide error');
end;
这样编译是没有问题了,但为什么运行到下面begin就停止了?
begin
Application.Initialize;
Application.CreateForm(TMainForm, MainForm);
Application.Run;
end.
作者: minipig520 发布时间: 2011-11-24
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28