1 #include 2 #include 3 #include 4 #include 5 6 HANDLE g_hEvent; 7 UINT __stdcall ThreadProc(LPVOID); 8 int main(int argc,char* argv[]) 9 { 10 unsigne... ...
分类:
其他好文 时间:
2017-02-01 23:41:09
阅读次数:
378
1 #include 2 #include 3 #include 4 #include 5 6 int g_nCount1 = 0,g_nCount2 = 0; 7 bool g_bThread = true; 8 UINT __stdcall ThreadProc(LPVOID); 9 int m... ...
分类:
其他好文 时间:
2017-02-01 23:37:49
阅读次数:
261
1 #include 2 #include 3 #include 4 #include 5 6 int g_nTlsNum; 7 UINT __stdcall ThreadProc(LPVOID); 8 void InitialStartTime(); 9 DWORD GetUsedTime(); ... ...
分类:
其他好文 时间:
2017-02-01 23:26:06
阅读次数:
200
Run Dr.memory on visual c++ 2013 详细检查项目 Dr. Memory's behavior can be controlled through options passed to drmemory prior to the "--" delimiter. Boolea ...
分类:
其他好文 时间:
2017-01-11 12:51:09
阅读次数:
219
要求: 子线程输出的线程序号不能重复。(主线程和子线程需要同步) 全局变量g_count的输出必须递增。(子线程之间需要互斥) 1,用临界区CRITICAL_SECTION来解决子线程之间的互斥 2用事件解决主线程和子线程的同步问题 //CreateEvent创建一个事件 HANDLE Create ...
分类:
编程语言 时间:
2017-01-01 23:48:23
阅读次数:
310
#include "stdafx.h" #include int g_count; const int ThreadNum = 10; DWORD __stdcall Func(LPVOID pm) { Sleep(10); g_count++; //InterlockedIncrement((LP... ...
分类:
编程语言 时间:
2017-01-01 18:57:43
阅读次数:
195
1 区别 VC++的C/C++函数有两种基本的调用约定:__stdcall、__cdecl。它们有什么区别呢?请参考下表: __stdcall__cdecl函数代码Cint __stdcall addS(int a,int b) { return a + b; }int __cdecl addC(i... ...
分类:
其他好文 时间:
2016-12-14 09:32:26
阅读次数:
261
目录 第1章 VB6.0调用DLL 1 1 VC++编写DLL 1 1.1 使用__stdcall 1 1.2 使用 .DEF 文件 1 2 简单数据类型 2 2.1 传值(ByVal) 2 2.2 传址(ByRef) 3 2.3 传址(VarPtr) 4 2.4 转换为Variant 4 3 St ...
分类:
其他好文 时间:
2016-12-10 18:54:07
阅读次数:
971
学习《Windows程序设计》记录 概念贴士: 1. 线程描述了进程内代码的执行路径。 2. _stdcall是新标准C/C++函数的调用方法。从底层来说,使用这种调用方法参数的进栈顺序和标准C调用(_cdecl方法)是一样的,但是_stdcall采用自动清栈的方式,而_cdecl采用的是手动清栈方 ...
分类:
编程语言 时间:
2016-11-30 16:54:27
阅读次数:
232
今天在整理资料的时候,翻出多年前在网上看到的一篇帖子,一个控制台的进度条,非常酷炫,原文出处-传送门。 记得在刚开始接触编程的时候,用控制台写些小工具玩,也喜欢将信息打印到屏幕上,看着不断闪动的屏幕觉得很酷,后来一次偶然的机会看到了这个进度条让控制台的输出又上了一个层次,感谢作者。 ...
分类:
其他好文 时间:
2016-11-26 02:27:32
阅读次数:
210