想问问怎么样创建VC程序才能包含到头文件LCNew.h头文件呢?近日,在网上看到一段程序,想拿来试试,结果出现了问题
fatal error C1083: Cannot open include file: 'LCNew.h': No such file or directory对LCNew.h头文件不清楚,不知道这个是干吗用的,望指点!!#include "stdafx.h"
#include "LCNew.h"
#include <tlhelp32.h> #ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// The one and only application objectCWinApp theApp;using namespace std;
void KillProgram(LPCSTR ExeName)
{
LPCSTR File;
HANDLE hProcessSnap;
PROCESSENTRY32 pe32;
if(!ExeName||!ExeName[0]) return;
File = strrchr(ExeName, '//');
if (File!=0) ExeName = File+1;
hProcessSnap = CreateToolhelp32Snapshot(
TH32CS_SNAPPROCESS, 0);
if(hProcessSnap==(HANDLE)-1) return;
memset(&pe32,0,sizeof(pe32));
pe32.dwSize=sizeof(PROCESSENTRY32);
if(Process32First(hProcessSnap,&pe32))
{
do
{
File = strrchr(pe32.szExeFile, '//');
File = File? File+1: pe32.szExeFile;
if (strcmpi(File,ExeName)==0)
{
TerminateProcess(OpenProcess(
PROCESS_ALL_ACCESS,0,pe32
.th32ProcessID), 0);
break;
}
}
while(Process32Next(hProcessSnap,&pe32));
}
CloseHandle(hProcessSnap);
}int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
cerr << _T("Fatal Error: MFC initialization failed") << endl;
nRetCode = 1;
}
else
{
//CString strHello;
//strHello.LoadString(IDS_HELLO);
//cout << (LPCTSTR)strHello << endl;
cout << "Kill ProccesA.exe" <<endl;
KillProgram("ProccesA.exe");
} return nRetCode;
}
fatal error C1083: Cannot open include file: 'LCNew.h': No such file or directory对LCNew.h头文件不清楚,不知道这个是干吗用的,望指点!!#include "stdafx.h"
#include "LCNew.h"
#include <tlhelp32.h> #ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// The one and only application objectCWinApp theApp;using namespace std;
void KillProgram(LPCSTR ExeName)
{
LPCSTR File;
HANDLE hProcessSnap;
PROCESSENTRY32 pe32;
if(!ExeName||!ExeName[0]) return;
File = strrchr(ExeName, '//');
if (File!=0) ExeName = File+1;
hProcessSnap = CreateToolhelp32Snapshot(
TH32CS_SNAPPROCESS, 0);
if(hProcessSnap==(HANDLE)-1) return;
memset(&pe32,0,sizeof(pe32));
pe32.dwSize=sizeof(PROCESSENTRY32);
if(Process32First(hProcessSnap,&pe32))
{
do
{
File = strrchr(pe32.szExeFile, '//');
File = File? File+1: pe32.szExeFile;
if (strcmpi(File,ExeName)==0)
{
TerminateProcess(OpenProcess(
PROCESS_ALL_ACCESS,0,pe32
.th32ProcessID), 0);
break;
}
}
while(Process32Next(hProcessSnap,&pe32));
}
CloseHandle(hProcessSnap);
}int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
cerr << _T("Fatal Error: MFC initialization failed") << endl;
nRetCode = 1;
}
else
{
//CString strHello;
//strHello.LoadString(IDS_HELLO);
//cout << (LPCTSTR)strHello << endl;
cout << "Kill ProccesA.exe" <<endl;
KillProgram("ProccesA.exe");
} return nRetCode;
}
而是添加头文件搜索目录的问题
查找LCNew.h,看在哪个目录,然后把此目录(加路径)添加到头文件搜索目录里