数组怎么传递?(100分)

  • 主题发起人 一天到晚游泳的瑜
  • 开始时间

一天到晚游泳的瑜

Unregistered / Unconfirmed
GUEST, unregistred user!
我现在在delhpi中的function中有一个数组型参数,然后在vc++中我要将其数组的值传递
过去,但执行的时候出现非法操作,请问这是为什么?
在delphi中函数申明为:
function speedfun(title,date:String;timearray:array of real;speedarray:array of Integer;
lowspeed,highspeed,number:Integer):Boolean;stdcall;
在vc++中函数申明为:
void (__stdcall *speedfun)(CString title,CString date,double time[],int speed[],
int lowspeed,int highspeed,int number);
调用为:
(*speedfun)(title,date,timearray,speedarray,lowspeed,highspeed,number);
 
不知道数组有什么问题,但是string肯定有问题
Delphi中的String和VC中的CString是两回事,不能这么传的
仔细学习一下Delphi和VC中的string的区别
 
接受答案了.
 

Similar threads

S
回复
0
查看
949
SUNSTONE的Delphi笔记
S
S
回复
0
查看
770
SUNSTONE的Delphi笔记
S
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
顶部