当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: 在进行多线程java/j2me/code/ target=_b
 

 

 ·谈vc++中的progress控件的使用    »显示摘要«
    摘要: progress控件能让人们感受到一个应用程序执行的进度,在很多应用程序中都能用到它,但通常只支持在单任务中,我在windows98/nt中文操作系统下,在vc++6.0环境下,利用线程编制了一个非常小巧的应用程序来实现progress控件的使用。它可以支持多线程,使用起来很方便。以下是这个应用程序的源代码://progressdialog.hclass cprogressdialog : p......
    摘要: 前言: 本文只提供vc6.0的编译说明,如果想知道vc.net下的编译过程请参看原文原文: http://www.voxgratia.org/docs/openh323_windows.html作者 :craig southeren翻译 : richard原文更新日期:2004年11月16日1.介绍 这是一篇彻底讲解如何用msvc6.0建立openh323的文章。这个篇文章是上一篇文章的延续,所......


AfxBeginThread函数初探
在进行多线程java/j2me/code/ target=_blank>程序设计的时候,我们经常用到afxbeginthread函数来启动一条线程

   afx_threadproc pfnthreadproc,//线程函数地址 【程序编程相关:在Dialog程序中使用WH_KEYBO

该函数使用起来非常的简单方便,其定义如下

cwinthread* afxbeginthread( 【推荐阅读:Visual C++ 编译器选项

   int npriority = thread_priority_normal,//线程优先级 【扩展信息:Quick and Dirty Seri

   lpvoid pparam,//线程参数

   uint nstacksize = 0,//线程堆栈大小,默认为1m

   dword dwcreateflags = 0,//

   lpsecurity_attributes lpsecurityattrs = null

);

cwinthread* afxbeginthread(

   cruntimeclass* pthreadclass,

   int npriority = thread_priority_normal,

   uint nstacksize = 0,

   dword dwcreateflags = 0,

   lpsecurity_attributes lpsecurityattrs = null

);

参数说明:

pfnthreadproc:线程函数的地址,该参数不能设置为null,线程函数必须定义成全局函数或者类的静态成员函数

例如:

uint mythreadfunc(lpvoid lparam)

或者

class a

{

public:

        static uint __stdcall mythreadfunc(lpvoid lparam);

}

之所以要定义成类的静态成员函数,是因为类的静态成员函数不属于某个类对象,这样在调用函数

的时候就不用传递一个额外的this指针.

pthreadclass:指向从cwinthread派生的子类对象的runtime_class

pparam:要传递给线程函数的参数

npriority:要启动的线程的优先级,默认优先级为thread_priority_normal(普通优先级),关于线程

 优先级的详细说明请参考platform sdk setthreadpriority函数说明

nstacksize:新线程的堆栈大小,如果设置为0,则使用默认大小,在应用程序中一般情况下线程的默认堆栈大小

 为1m


...   下一页
 ·visual c++ mfc 中常用宏的含义    »显示摘要«
    摘要:and_catchand_catch   and_catch(exception_class,exception _object_point_name)   说明:   定义一个代码块,它用于获取废除当前try块中的附加异常类型。使用catch宏以获得一个异常类型,然后使用and_catch宏获得随后的异常处理代码可以访问异常对象(若合适的话)已得到关于异常的特别原因的更多消息。在and_catc......
» 本期热门文章:

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