查询时加上Application.ProcessMessages;试试

解决方案 »

  1.   

    to bee2518(迷茫ing) :
    在什么地方加??
      

  2.   

    是在timer控件的ontimer中加吗?
      

  3.   

    你把TIMER事件写到一个线程中去
      

  4.   

    你在主程序用view as text把代码改下看
      

  5.   

    难道timer不是另外开了一个线程吗???
      

  6.   

    to whbo(王红波(以后不能午休了)) 
      你在主程序用view as text把代码改下看???
      什么意思哦?
      

  7.   

    TIMER并没有单独开线程,只是利用了操作系统的定时消息机制;
      

  8.   

    在循环中加Application.ProcessMessages;
      

  9.   

    是在每一个while循环都需要Application.ProcessMessages;??
      

  10.   

    while 1=1 do
              begin
                Application.ProcessMessages;
                r:=TV_GetDTMFChar(channel);
                if  r=35 then
                begin
                  Break;
                end
                else
                begin
                  sCome:= sCome+ chr(r);
                end;
              end;
    是这样吗???
      

  11.   

    你的timer事件占用cpu太多,建议用线程
      

  12.   

    不要那个,while 1=1 do很耗cpu timer1.Interval:=5000;然后再ontimer里触发你要的事件就可以了!!
      

  13.   

    OnTime()
    {
       r:=TV_GetDTMFChar(channel);
       if  r=35 then
                begin
                  Break;
                end
                else
                begin
                  sCome:= sCome+ chr(r);
                end;
              end;
    Application.ProcessMessages;
    end;
      

  14.   

    不要那个,while 1=1 do很耗cpu timer1.Interval:=5000;
      

  15.   

    在开一个线程中动态添加一个timer控件,怎么样在动态添加得ontime事件中的值返回到主界面中
    是不是要用到线程同步??
      

  16.   

    begin 
      r:=TV_GetDTMFChar(channel);
      if  r=35 then   Break
      else
      begin
        sCome:= sCome+ chr(r);
      end;
      Application.ProcessMessages;
    end;Application.ProcessMessages的作用是:在程序执行过程中,还是在不断的接受来自程序外部的消息(如:鼠标、键盘等)。应用这个函数可以避免程序发生呆死现象。请楼主试一下,毕竟实践才是检验真理的唯一标准。 
    ^_^