http://codeguru.earthweb.com/misc/ThreadDemo.html
A Generic C++ Thread Class - Arun N Kumar.
Overcome the the lack of Object Oriented Programmability in using worker threads.
A Generic C++ Thread Class - Arun N Kumar.
Overcome the the lack of Object Oriented Programmability in using worker threads.
CallerInfo是局部变量,很快就在堆栈中破坏了,所以不能得到
{
LPCALLER_INFO *pCInfo = (LPCALLER_INFO *)p;
//这样即可,不要new}
to masterz:请具体说说这类问题怎么解决撒,谢谢了。
.....给成员变量赋值后,
_beginthread(SaveCallerInfoThread,0,(void *)pCallerInfo);void SaveCallerInfoThread(void *p)
{
CALLER_INFO CInfo;
memcpy(&CInfo, p, sizeof(CALLER_INFO));
delete (CALLER_INFO*)p;}