point:=fitem.Objects[0];
 @temp1 := point;
看看是不是这样?
point:=fitem.Objects[0];
TFlowTime(point)^.时间;
或者直接用
TFlowTime(fitem.Objects[0])^.时间;
还有啊,你用new 分配了地址空间,怎么没有dispose呢??

解决方案 »

  1.   

    LabeledEdit1.Text:=TimeToStr(TFlowTime(fitem.Objects[0])^.BeginTime);
    LabeledEdit3.Text:=IntToStr(TFlowTime(fitem.Objects[0])^.ARect.left);
    老大还是有错!!!
      

  2.   

    procedure TForm1.Button2Click(Sender: TObject);
    var temp1 : tflowPoint;  //
        point : Pointer;
    begin
     point:=fitem.Objects[0];
     temp1 := TFlowPoint(Point);
     ShowMessage(TimeToStr(Temp1^.EndTime));
    end;
      

  3.   

    啊,不对啊,看错了!!
    是 TFlowPoint(fitem.Objects[0])^.ARect.left
    是  TFlowPoint!!!
      

  4.   

    大哥,上面的代码可以编译通过但是结果不正确
    本来endtime是12:30:00的结果显示出来是0:00:00
    谢谢,加油!!!!
    还有这句话这样编译不能通过FItem.AddObject('aa',temp);
    改成FItem.AddObject('aa',@temp);可以通过!
      

  5.   


    FItem.AddObject('aa',temp);
    该为  FItem.AddObject('aa',Tobject(temp));

     point:=fitem.Objects[0];
     @temp1 := point;
    该为
     temp1 := TFlowPoint(fitem.Objects[0])^;就可以了
      

  6.   

    FItem.AddObject('aa',TObject(temp));
      

  7.   

    看出来了,不过你用的是tstringlist啊;
    该为tlist没有问题的;  new(temp);
      fitem := tlist.create;
      temp^.BeginTime := strtotime('12:30:00');
      temp^.EndTime := strtotime('12:30:00');
      temp^.ARect :=Rect(100,100,100,100);
      Temp^.Selected := false;
      FItem.Add(temp);
      dispose(temp)ShowMessage(TimeToStr(tflowPoint(fitem.Items[0])^.EndTime));
      

  8.   

    呵谢谢各位大哥了我想问一下释放内存什么时候就好???
    FItem.AddObject('aa',TObject(temp));
    之后就释放还是,
    最后不用时释放???
      

  9.   

    在Tstringlist free或delete的时候释放比较好,不然容易造成空指针或内存泄漏
      

  10.   

    自定义的类型最好使用TList进行存储,不要使用TStringList!!!
    TList是一个链表!!!
      

  11.   

    在Form的Close事件中.
      if temp <> nil then
        Dispose(temp);
      if fitem <> nil then
        fitem.Free;
      

  12.   

    to Delphi_Li(Delphi Li)Tstringlist很好用呀,特别是在生成字符川对照表的时候,为什么要要建议人家去用Tlist呢?
      

  13.   

    添加
     New(temp);
     temp.BeginTime := strtotime('12:30:00');
     temp.EndTime := strtotime('12:30:00');
     ...
     FItem.AddObject('aa',Pointer(temp));
    此时不能释放temp,不然会释放掉才加进去的东东。只能在确认不会再使用时才释放。使用
    TFlowTime (FItem.Objects[0]).BeginTime ;释放
    FItem.Delete(0);
      

  14.   

    to  888789(yf888789) 
    你这样释放会造成内存泄漏的
      

  15.   

    其实释放内存是在Try.....finally....结构中进行的。
    如:
    try
      temp:=tflowTime.create();
    finally
      temp.free;
    end;Tstringlist.addobject(string,object)使用一个字符串连接一个对象。将
     point:=fitem.Objects[0];
     @temp1 := point;
    该为
     temp1 := TFlowPoint(fitem.Objects[0]);即可。
      

  16.   

    增加
     New(temp);
     temp.BeginTime := strtotime('12:30:00');
     temp.EndTime := strtotime('12:30:00');
     ...
     FItem.AddObject('aa',Pointer(temp));
    使用
    var FlowTime : TFlowTime;   FlowTime := TFlowTime (FItem.Objects[0]);
      

  17.   

    procedure TForm1.Button2Click(Sender: TObject);
    var temp1 : TFlowPoint;//tflowTime;
       point : Pointer;
       
    begin
     point:=fitem.Objects[0];
     //@temp1 := point;
      temp1 := Point;
      ShowMessage(tiemToStr(Temp1^.BeginTime));
       
    end;
      

  18.   

    对于指针
    我倒是很熟
    不过还在学习 Delphi 中
      

  19.   

    : kmzym()
    当然先要将里面放掉,对不起。我写掉了!