- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
多线程编程之二——mfc中的多线开发(Multithreaded programming two - multi line development in MFC)
多线程编程之二——mfc中的多线开发(Multithreaded programming two - multi line development in MFC)
MFC support for multithreaded programming
There are two types of threads in MFC, called worker threads and user interface threads, respectively. The main difference between the two is that worker threads do not have message loops, and user interface threads have their own message queues and message loops.
Worker threads have no messaging mechanisms, which are often used to perform background calculations and maintenance tasks such as lengthy computing processes, printer background printing, and so on. User interface threads are typically used to handle user input other than the execution of other threads, and to respond to events and messages generated by users and systems. But for Win32s API programming, there is no difference between the two threads. They all start the thread with only the threads starting address to perform the task.
In MFC, the global function AfxBeginThread () is used to create and initialize the operation of a thread that has two overloaded forms, used to create worker threads and user interface threads, respectively. The two overloaded functions, prototypes, and parameters, are described below:
(1) CWinThread* AfxBeginThread (AFX_THREADPROC pfnThreadProc),
LPVOID pParam,
NPriority=THREAD_PRIORITY_NORMAL,
UINT nStackSize=0,
DWORD dwCreateFlags=0,
LPSECURITY_ATTRIBUTES lpSecurityAttrs=NULL);
PfnThreadProc: points to the pointer of the worker threads execution function, and the thread function prototype must declare as follows: UINT ExecutingFunction (LPVOID pParam);
Note that ExecutingFunction () should return a value of type UINT to indicate the end of the function. Typically, a return of 0 indicates successful execution.
PParam: a 32 bit argument passed to the thread function, which is interpreted in some way by the executing function. It can be numeric, or pointer to a structure, and can even be ignored;
NPriority: thread priority. If 0, the thread has the same
您可能关注的文档
- 同位语从句(Appositive clause).doc
- 同学三十年聚会致辞(Students' thirty years' meeting speech).doc
- 同景地产持续创销售奇迹,成为地产行业的神话(King estate continued to record sales miracle, become the real estate industry myth).doc
- 同步异步知识(Synchronous asynchronous knowledge).doc
- 合伙中国的众筹平台风险分析(Risk analysis of partner raising platforms in China).doc
- 同济医科大学药学专业教学计划 - 华中科技大学(Pharmacy teaching program of Tongji Medical University - Huazhong University of Science and Technology).doc
- 名人里(Celebrity).doc
- 名字游戏(Name game).doc
- 名侦探柯南经典语句(Detective Conan classic sentence).doc
- 名侦探柯南经典语录(Detective Conan Classic Quotes).doc
最近下载
- 人教版九年级(初三)道德与法治下册全册教案.pdf VIP
- 会计学原理课程实验(第六版)张志康习题答案解析.pdf
- 20S517- 排水管道出水口.pdf VIP
- Bose博士SoundTouch 300 Soundbar 扬声器说明书.pdf
- 集团数字化中台系统建设项目_用户手册_设备主数据.docx VIP
- 17J008 挡土墙(重力式、衡重式、悬臂式)(最新).pdf VIP
- 具身智能的基础知识(68页 PPT).pptx
- 贵州医科大学2024-2025学年第2学期《生物化学》期末考试试卷(B卷)附参考答案.docx
- 仪表桥架及保护管安装培训2(2021-03).pptx VIP
- 电气控制及PLC技术期末试卷.docx
原创力文档


文档评论(0)