昨天一个同学问到为何界面上进度条被碰一下后就不动了。最直接的原因就是由于她采用的是单线程。所以手工写了个小例子来解决问题。
我直接采用C++类模板来实现这个过程。 (1)首先我新建一个.h文件,不需要source 文件,定义为命名为runsss.h,将该类改为模板类,然后只要在其中只写一个函数命名为insar(),这便是主函数,我们的大程序都可写在里面 该.h文件的全部代码如下,很简单。 // runsss.h: interface for the runsss class. template<class T1> class runsss; template<class T1> class runsss { public: runsss(); virtual ~runsss(); BOOL Insar(){ for(int i=0;i<100000000.0;i++) |
[转]关于VC下多线程和进度条实时显示
最新推荐文章于 2022-10-18 10:13:58 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)