函数
  Bool SetClock(Addr as integer,Itime() as Date)
参数说明:
Addr 与第三个函数相同。
Itime() 是一个日期型的一维数组,它的每个元素代表一个打铃时间点。最多只能设置13个打铃的时间点。
NOTE:使用者务必注意Itime() 数组的每个元素是以“HH:MM:SS”形式的日期数据。不要把“YY/MM/DD”格式的数据传给数组。
RETURN:设置成功返回TRUE,否则返回FALSE。
Example:
Var
  Addr:integer;
  BooleanFlag:Boolean;
  Itime:array[1..13] of Ttime;
BooleanFlag:=Object.setclock(addr,Itime);程序procedure TF_KQDLL.Button1Click(Sender: TObject);
var
 tt:array[1..13] of Ttime;
begin
  TT[1]:=StrToTime(FormatDateTime('HH:MM:SS',now));
    .
    .
    .
  TT[13]:=StrToTime(FormatDateTime('HH:MM:SS',now));  KQDLL.setclock(21,TT);end;提示 
[Error] U_KQDLL.pas(95): Type not allowed in OLE Automation call
[Fatal Error] KQDLL.dpr(5): Could not compile used unit 'U_KQDLL.pas'

解决方案 »

  1.   

    VARIANT类型是VT_DATE在vb中以 Date 类型出现,使用四个字节以 Double 格式存储 Date
      

  2.   

    Bool SetClock(Addr as integer,Itime() as Date)这个好像不是d的函数,在d中只能以开放数组传递数组参数也就是说itime必须是一个开放数组而不能是date类型。
      

  3.   

    要传递一个数组值,给setclock 不要传递数组地址。
      

  4.   

    procedure TF_KQDLL.Button1Click(Sender: TObject);
    var
    vtime:olevariant;
    vt :array of ttime;
    t1:VARIANT;
    i:integer;
    begin
     t1:=StrToTime( FormatDateTime('HH:MM:SS',DateTimePicker1.Time));
     vtime:=vararraycreate([1,13],   varVariant);
     for i:=1 to 13 do  vtime[i]:=t1+i;
     KQDLL.setclock(18,vtime);
    end;
      

  5.   

    d中传递数组要声明开放数组,但就你那个setclock函数,我不知道能不能运行通过,那个函数不像是delphi原形,例如这样:type
      TTimeArray=array of TTime;procedure TF_KQDLL.Button1Click(Sender: TObject);
    var
    vtime:TTimeArray;
    i:integer;
    begin
     t1:=StrToTime( FormatDateTime('HH:MM:SS',DateTimePicker1.Time));
     setlength(vtime,13);
     for i:=low(vtime) to high(vtime) do  vtime[i]:=StrToTime( FormatDateTime('HH:MM:SS',DateTimePicker1.Time));
     KQDLL.setclock(18,vtime);
    end;