当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

 ·    »显示摘要«
    摘要: ^_^ ......
 ·一个接口函数    »显示摘要«
    摘要: win2000自带ftp服务。请问用哪个函数可以控制ftp的开,关,暂停。 谢谢了 ......


问一个今天写程序遇到的问题。

我的一个程序需要大量的运算,在此期间我发现程序窗口根本不  
   
  响应外部的任何动作,任务管理器也是显示该程序没有响应  
   
  但是我把它放在DOS下运行却没有这样的问题存在。  
   
  请问是为什么?  
   
 

NO.1   作者: yyfzy

一直占用主线程

NO.2   作者: myy

多线程

NO.3   作者: teatool

在你的循环中加入Application->ProcessMessage();

NO.4   作者: gfh_79_0

BCB帮助   ProcessMessage  
   
  This   example   uses   two   buttons   that   are   long   enough   to   accommodate   lengthy   captions   on   a   form.   When   the   user   clicks   the   button   with   the   caption   Ignore   Messages,   the   code   begins   to   generate   a   long   series   of   random   numbers.   If   the   user   tries   to   resize   the   form   while   the   handler   is   running,   nothing   happens   until   the   handler   is   finished.   When   the   user   clicks   the   button   with   the   caption   Process   Messages,   more   random   numbers   are   generated,   but   Windows   can   still   respond   to   a   series   of   mouse   events,   such   as   resizing   the   form.  
   
  Note: How   quickly   these   event   handlers   run   depends   on   the   microprocessor   of   your   computer.   A   message   appears   on   the   form   informing   you   when   the   handler   has   finished   executing.  
   
  void   __fastcall   TForm1::FormCreate(TObject*   Sender)  
   
  {  
      Button1->Caption   =   "Ignore   Messages";  
      Button2->Caption   =   "Handle   Message";  
  }  
   
  void   __fastcall   TForm1::Button1Click(TObject*   Sender)  
  {  
      int   x,   y;  
      for   (int   i   =   0;   i   <   64000;   i++)  
    {  
          Randomize();  
          for   (int   j   =   0;   j   <   64000;   j++)  
              y   =   random(j);  
          x   =   random(i);  
      }  
      Canvas->TextOut(10,   10,   "The   Button1Click   handler   is   finished");  
  }  
   
  void   __fastcall   TForm1::Button2Click(TObject   *Sender)  
   
  {  
      int   x,   y;  
      for   (int   i   =   0;   i   <   64000;   i++)  
      {  
          Randomize();  
          for   (int   j   =   0;   j   <   64000;   j++)  
          {  
              y   =   random(j);  
              Application->ProcessMessages();  
          }  
          x   =   random(i);  
      }  
      Canvas->TextOut(10,   10,   "The   Button2Click   handler   is   finished");  
  }

NO.5   作者: qiuafa

不要在你的处理过程中响应消息

NO.6   作者: ThinkX

用多线程是最好的办法,加ProcessMessage太浪费了。

NO.7   作者: DaMimit

我看不一定,不知道他的东西是不是线程安全的。  
  还有,象你这样用的大量运算的,可以考虑用matlab的库了。  
 


    摘要: 我做了一个网站a,为了维护网站a中的动态内容我又采用asp.net做了一个web管理系统b。a位于wwwroot下,而b位于a的子文件夹里。当然b也可以和a都位于wwwroot下,但a和b的文件混在一起,不便以后的查看和维护。在我的机子上,在iis中我把a创建为应用程序,而b虽然在a的子目录里,但不能运行。我又把b也创建为应用程序,这时a和b都能正常运行了。 我把a上传到提供商的服务器上,......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE