结果Compile的时候没有问题,在我点击Build的时候出现了下面的错误提示。
网上也有很多介绍这个错误的,但是说法各不一致,我试了好多种,最终还是决定到这里来请教一下大侠。
望指点。
Compiling...
111206_KillProcess_taskmgr.cpp
f:\c workspace\111206_killprocess_taskmgr\processnametoid.h(16) : error C2146: syntax error : missing ';' before identifier 'GetProcessID'
f:\c workspace\111206_killprocess_taskmgr\processnametoid.h(16) : error C2501: 'DWORD' : missing storage-class or type specifiers
f:\c workspace\111206_killprocess_taskmgr\processnametoid.h(21) : error C2146: syntax error : missing ';' before identifier 'm_hSnapshot'
f:\c workspace\111206_killprocess_taskmgr\processnametoid.h(21) : error C2501: 'HANDLE' : missing storage-class or type specifiers
f:\c workspace\111206_killprocess_taskmgr\processnametoid.h(21) : error C2501: 'm_hSnapshot' : missing storage-class or type specifiers
F:\C Workspace\111206_KillProcess_taskmgr\111206_KillProcess_taskmgr.cpp(8) : error C2146: syntax error : missing ';' before identifier 'KillJob'
F:\C Workspace\111206_KillProcess_taskmgr\111206_KillProcess_taskmgr.cpp(8) : error C2501: 'BOOL' : missing storage-class or type specifiers
F:\C Workspace\111206_KillProcess_taskmgr\111206_KillProcess_taskmgr.cpp(8) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
// ProcessNametoID.h: interface for the CProcessNametoID class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_PROCESSNAMETOID_H__4217BFFA_FB96_4DAF_A665_3EF82774CD57__INCLUDED_)
#define AFX_PROCESSNAMETOID_H__4217BFFA_FB96_4DAF_A665_3EF82774CD57__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CProcessNametoID
{
public:
DWORD GetProcessID( char* m_cName );
CProcessNametoID();
virtual ~CProcessNametoID();
private:
HANDLE m_hSnapshot;
};
#endif // !defined(AFX_PROCESSNAMETOID_H__4217BFFA_FB96_4DAF_A665_3EF82774CD57__INCLUDED_)
// ProcessNametoID.cpp: implementation of the CProcessNametoID class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ProcessNametoID.h"
#include <Tlhelp32.h>
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CProcessNametoID::CProcessNametoID()
{
this ->m_hSnapshot = NULL;
}
CProcessNametoID::~CProcessNametoID()
{
}
DWORD CProcessNametoID::GetProcessID(char *m_cName)
{
DWORD m_dwPid = 0;
BOOL m_bStatus = false;
PROCESSENTRY32 m_ppe;
::memset( &m_ppe, 0, sizeof( PROCESSENTRY32 ) );
m_ppe.dwSize = sizeof( PROCESSENTRY32 );
__try
{
this ->m_hSnapshot = ::CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); //创建进程快照
if ( this ->m_hSnapshot == NULL )
{
__leave;
}
m_bStatus == ::Process32First( this ->m_hSnapshot, &m_ppe ); //开始枚举进程
int a = ::GetLastError();
while ( m_bStatus )
{
char *current;
current = m_ppe.szExeFile();
if ( lstrcmpi( m_cName, current ) ) //忽略大小写
{
m_bStatus::Process32Next( this ->m_hSnapshot, &m_ppe );
}
else
{
m_dwPid = m_ppe.th32ProcessID;
m_bStatus = false;
}
}
}
__finally
{
::CloseHandle( this ->m_hSnapshot );
return m_dwPid;
}
}
// 111206_KillProcess_taskmgr.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "ProcessNametoID.h"
BOOL KillJob( CString strProcessName, CString strJobName )
int main()//int argc, char* argv[] )
{
BOOL bRet = FALSE;
bRet = KillJob( "QQ.exe", "KillQQ" );
if ( bRet )
MessageBox( NULL, "QQ成功结束!", "提示", MB_OK );
return 0;
}
BOOL KillJob( CString strProcessName, CString strJobName )
{
HANDLE hJob = CreateJobObject( NULL, TEXT( strJobName ) ); //建立Job对象
DWORD dwPid = GetProcessID( ( LPTSTR )( LPCTSTR )strProcessName ); //建立QQ进程PID
HANDLE hProcess = OpenProcess( PROCESS_ALL_ACCESS, TRUE, dwPid ); //获取QQ进程句柄
if ( !hProcess )
{
MessageBox( "Open process error!" );
return FALSE;
}
AssignProcessToJobObject( hJob, hProcess ); //将进程和对象关联起来
BOOL hRet = TerminateJobObject( hJob, 0 ); //终止作业
if ( !bRet )
return FALSE;
else
return TRUE;
}
12 个解决方案
#1
#include <windows.h>
#2
// testkillQQ.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "afxwin.h"
#include "windows.h"
#include "Tlhelp32.h"
HANDLE CreateJobObject(
LPSECURITY_ATTRIBUTES lpJobAttributes, // SD
LPCTSTR lpName // job name
);
BOOL AssignProcessToJobObject(
HANDLE hJob, // handle to job
HANDLE hProcess // handle to process
);
BOOL TerminateJobObject(
HANDLE hJob, // handle to job
UINT uExitCode // exit code
);
typedef HANDLE ( *pcre )( LPSECURITY_ATTRIBUTES, LPCTSTR );
typedef BOOL ( *pass )( HANDLE, HANDLE );
typedef BOOL ( *pter )( HANDLE, HANDLE );
HANDLE m_hSnapshot = NULL;
DWORD GetProcessID(char *m_cName)
{
DWORD m_dwPid = 0;
BOOL m_bStatus = false;
PROCESSENTRY32 m_ppe;
::memset( &m_ppe, 0, sizeof( PROCESSENTRY32 ) );
m_ppe.dwSize = sizeof( PROCESSENTRY32 );
__try
{
m_hSnapshot = ::CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); //创建进程快照
if ( m_hSnapshot == NULL )
{
__leave;
}
m_bStatus = ::Process32First( m_hSnapshot, &m_ppe ); //开始枚举进程
int a = ::GetLastError();
while ( m_bStatus )
{
char *current;
current = m_ppe.szExeFile;
if ( lstrcmpi( m_cName, current ) ) //忽略大小写
{
m_bStatus = ::Process32Next( m_hSnapshot, &m_ppe );
}
else
{
m_dwPid = m_ppe.th32ProcessID;
m_bStatus = false;
}
}
}
__finally
{
::CloseHandle( m_hSnapshot );
return m_dwPid;
}
}
BOOL KillJob( CString strProcessName, CString strJobName )
{
HMODULE h;
h = LoadLibrary( "kernel32.dll" );
if( h )
{
pcre cre;
pass ass;
pter ter;
cre = ( pcre )::GetProcAddress( h, "CreateJobObject" );
ass = ( pass )::GetProcAddress( h, "AssignProcessToJobObject" );
ter = ( pter )::GetProcAddress( h, "TerminateJobObject" );
if( !cre || !ass || !ter )
{
return FALSE;
}
//HANDLE hJob = ( HANDLE )CreateJobObject( NULL, TEXT( strJobName ) ); //建立Job对象
HANDLE hJob = ( HANDLE )cre( NULL, TEXT( strJobName ) ); //建立Job对象
DWORD dwPid = GetProcessID( ( LPTSTR )( LPCTSTR )strProcessName ); //建立QQ进程PID
HANDLE hProcess = OpenProcess( PROCESS_ALL_ACCESS, TRUE, dwPid ); //获取QQ进程句柄
if ( !hProcess )
{
AfxMessageBox( "Open process error!" );
return FALSE;
}
//AssignProcessToJobObject( hJob, hProcess ); //将进程和对象关联起来
ass( hJob, hProcess ); //将进程和对象关联起来
//BOOL bRet = TerminateJobObject( hJob, 0 ); //终止作业
BOOL bRet = ter( hJob, 0 ); //终止作业
if ( !bRet )
{
return FALSE;
}
else
{
return TRUE;
}
FreeLibrary( h );
}
else
{
return FALSE;
}
}
int main()//int argc, char* argv[] )
{
BOOL bRet = FALSE;
bRet = KillJob( "QQ.exe", "KillQQ" );
if ( bRet )
MessageBox( NULL, "QQ成功结束!", "提示", MB_OK );
return 0;
}
#3
// testkillQQ.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "afxwin.h"
#include "windows.h"
#include "Tlhelp32.h"
HANDLE CreateJobObject(
LPSECURITY_ATTRIBUTES lpJobAttributes, // SD
LPCTSTR lpName // job name
);
BOOL AssignProcessToJobObject(
HANDLE hJob, // handle to job
HANDLE hProcess // handle to process
);
BOOL TerminateJobObject(
HANDLE hJob, // handle to job
UINT uExitCode // exit code
);
typedef HANDLE ( __stdcall *pcre )( LPSECURITY_ATTRIBUTES, LPCTSTR );
typedef BOOL ( __stdcall *pass )( HANDLE, HANDLE );
typedef BOOL ( __stdcall *pter )( HANDLE, HANDLE );
HANDLE m_hSnapshot = NULL;
DWORD GetProcessID(char *m_cName)
{
DWORD m_dwPid = 0;
BOOL m_bStatus = false;
PROCESSENTRY32 m_ppe;
::memset( &m_ppe, 0, sizeof( PROCESSENTRY32 ) );
m_ppe.dwSize = sizeof( PROCESSENTRY32 );
__try
{
m_hSnapshot = ::CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); //创建进程快照
if ( m_hSnapshot == NULL )
{
__leave;
}
m_bStatus = ::Process32First( m_hSnapshot, &m_ppe ); //开始枚举进程
int a = ::GetLastError();
while ( m_bStatus )
{
char *current;
current = m_ppe.szExeFile;
if ( lstrcmpi( m_cName, current ) ) //忽略大小写
{
m_bStatus = ::Process32Next( m_hSnapshot, &m_ppe );
}
else
{
m_dwPid = m_ppe.th32ProcessID;
m_bStatus = false;
}
}
}
__finally
{
::CloseHandle( m_hSnapshot );
return m_dwPid;
}
}
BOOL KillJob( CString strProcessName, CString strJobName )
{
HMODULE h;
h = LoadLibrary( "kernel32.dll" );
if( h )
{
pcre cre;
pass ass;
pter ter;
cre = ( pcre )::GetProcAddress( h, "CreateJobObjectA" );
ass = ( pass )::GetProcAddress( h, "AssignProcessToJobObject" );
ter = ( pter )::GetProcAddress( h, "TerminateJobObject" );
if( !cre || !ass || !ter )
{
return FALSE;
}
//HANDLE hJob = ( HANDLE )CreateJobObject( NULL, TEXT( strJobName ) ); //建立Job对象
HANDLE hJob = ( HANDLE )cre( NULL, TEXT( strJobName ) ); //建立Job对象
DWORD dwPid = GetProcessID( ( LPTSTR )( LPCTSTR )strProcessName ); //建立QQ进程PID
HANDLE hProcess = OpenProcess( PROCESS_ALL_ACCESS, TRUE, dwPid ); //获取QQ进程句柄
if ( !hProcess )
{
AfxMessageBox( "Open process error!" );
return FALSE;
}
//AssignProcessToJobObject( hJob, hProcess ); //将进程和对象关联起来
ass( hJob, hProcess ); //将进程和对象关联起来
//BOOL bRet = TerminateJobObject( hJob, 0 ); //终止作业
BOOL bRet = ter( hJob, 0 ); //终止作业
if ( !bRet )
{
return FALSE;
}
else
{
return TRUE;
}
FreeLibrary( h );
}
else
{
return FALSE;
}
}
int main()//int argc, char* argv[] )
{
BOOL bRet = FALSE;
bRet = KillJob( "QQ.exe", "KillQQ" );
if ( bRet )
MessageBox( NULL, "QQ成功结束!", "提示", MB_OK );
return 0;
}
调试运行成功
#4
谢谢楼上!!
程序的确运行成功了
但是有个问题就是,我这个程序的目的就是想杀QQ进程,为什么一点反应都没有呢?
提示“QQ成功结束”,但实际上,QQ并没有结束啊!
这个程序没有达到我要杀进程的效果呢!
望指点
程序的确运行成功了
但是有个问题就是,我这个程序的目的就是想杀QQ进程,为什么一点反应都没有呢?
提示“QQ成功结束”,但实际上,QQ并没有结束啊!
这个程序没有达到我要杀进程的效果呢!
望指点
#5
不会吧,俺在win7 + qq2010都测试成功了。qq毫无声息的就退出了。
#6
俺用vc6 编译的。mbcs 控制台工程。
#7
的确没有任何反应,我也是VC6.0, Win32 Console Application。。。。。
是不是Kernel32.dll问题啊?
HMODULE h;
h = LoadLibrary( "kernel32.dll" );
还想问一下这两句语句是什么用?
是不是Kernel32.dll问题啊?
HMODULE h;
h = LoadLibrary( "kernel32.dll" );
还想问一下这两句语句是什么用?
#8
我在C盘拷贝了一个Kernel32.dll文件到工程文件夹,并导入了,还是没有任何反应
#9
cre = ( pcre )::GetProcAddress( h, "CreateJobObjectA" ); 这里为什么是CreateJobObjectA而不是CreateJobObject呢?
关键是我用CreateJobObjectA的时候会提示“QQ成功结束!”(实际上并没有结束)
而使用CreateJobObject的时候则完全没有任何提示。
这里我也不明白,CreateJobObjectA不是都没有定义吗??
关键是我用CreateJobObjectA的时候会提示“QQ成功结束!”(实际上并没有结束)
而使用CreateJobObject的时候则完全没有任何提示。
这里我也不明白,CreateJobObjectA不是都没有定义吗??
#10
CreateJobObject
是一个带字符串的函数,不同的工程要对应不同的版本,ansi工程对应CreateJobObjectA,unicode工程对应CreateJobObjectW,所以你用CreateJobObject是不对的。
是一个带字符串的函数,不同的工程要对应不同的版本,ansi工程对应CreateJobObjectA,unicode工程对应CreateJobObjectW,所以你用CreateJobObject是不对的。
#11
哦,明白了!
但是既然不是CreateJobObject这个问题的话,那么会是什么原因呢,我电脑上运行成功,提示“QQ成功结束!”,但实际上QQ还在呢!!
求指教! 会是哪里没注意到呢?
但是既然不是CreateJobObject这个问题的话,那么会是什么原因呢,我电脑上运行成功,提示“QQ成功结束!”,但实际上QQ还在呢!!
求指教! 会是哪里没注意到呢?
#12
把vfw.h和lib,“vfw.lib放在#endif前一行
#1
#include <windows.h>
#2
// testkillQQ.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "afxwin.h"
#include "windows.h"
#include "Tlhelp32.h"
HANDLE CreateJobObject(
LPSECURITY_ATTRIBUTES lpJobAttributes, // SD
LPCTSTR lpName // job name
);
BOOL AssignProcessToJobObject(
HANDLE hJob, // handle to job
HANDLE hProcess // handle to process
);
BOOL TerminateJobObject(
HANDLE hJob, // handle to job
UINT uExitCode // exit code
);
typedef HANDLE ( *pcre )( LPSECURITY_ATTRIBUTES, LPCTSTR );
typedef BOOL ( *pass )( HANDLE, HANDLE );
typedef BOOL ( *pter )( HANDLE, HANDLE );
HANDLE m_hSnapshot = NULL;
DWORD GetProcessID(char *m_cName)
{
DWORD m_dwPid = 0;
BOOL m_bStatus = false;
PROCESSENTRY32 m_ppe;
::memset( &m_ppe, 0, sizeof( PROCESSENTRY32 ) );
m_ppe.dwSize = sizeof( PROCESSENTRY32 );
__try
{
m_hSnapshot = ::CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); //创建进程快照
if ( m_hSnapshot == NULL )
{
__leave;
}
m_bStatus = ::Process32First( m_hSnapshot, &m_ppe ); //开始枚举进程
int a = ::GetLastError();
while ( m_bStatus )
{
char *current;
current = m_ppe.szExeFile;
if ( lstrcmpi( m_cName, current ) ) //忽略大小写
{
m_bStatus = ::Process32Next( m_hSnapshot, &m_ppe );
}
else
{
m_dwPid = m_ppe.th32ProcessID;
m_bStatus = false;
}
}
}
__finally
{
::CloseHandle( m_hSnapshot );
return m_dwPid;
}
}
BOOL KillJob( CString strProcessName, CString strJobName )
{
HMODULE h;
h = LoadLibrary( "kernel32.dll" );
if( h )
{
pcre cre;
pass ass;
pter ter;
cre = ( pcre )::GetProcAddress( h, "CreateJobObject" );
ass = ( pass )::GetProcAddress( h, "AssignProcessToJobObject" );
ter = ( pter )::GetProcAddress( h, "TerminateJobObject" );
if( !cre || !ass || !ter )
{
return FALSE;
}
//HANDLE hJob = ( HANDLE )CreateJobObject( NULL, TEXT( strJobName ) ); //建立Job对象
HANDLE hJob = ( HANDLE )cre( NULL, TEXT( strJobName ) ); //建立Job对象
DWORD dwPid = GetProcessID( ( LPTSTR )( LPCTSTR )strProcessName ); //建立QQ进程PID
HANDLE hProcess = OpenProcess( PROCESS_ALL_ACCESS, TRUE, dwPid ); //获取QQ进程句柄
if ( !hProcess )
{
AfxMessageBox( "Open process error!" );
return FALSE;
}
//AssignProcessToJobObject( hJob, hProcess ); //将进程和对象关联起来
ass( hJob, hProcess ); //将进程和对象关联起来
//BOOL bRet = TerminateJobObject( hJob, 0 ); //终止作业
BOOL bRet = ter( hJob, 0 ); //终止作业
if ( !bRet )
{
return FALSE;
}
else
{
return TRUE;
}
FreeLibrary( h );
}
else
{
return FALSE;
}
}
int main()//int argc, char* argv[] )
{
BOOL bRet = FALSE;
bRet = KillJob( "QQ.exe", "KillQQ" );
if ( bRet )
MessageBox( NULL, "QQ成功结束!", "提示", MB_OK );
return 0;
}
#3
// testkillQQ.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "afxwin.h"
#include "windows.h"
#include "Tlhelp32.h"
HANDLE CreateJobObject(
LPSECURITY_ATTRIBUTES lpJobAttributes, // SD
LPCTSTR lpName // job name
);
BOOL AssignProcessToJobObject(
HANDLE hJob, // handle to job
HANDLE hProcess // handle to process
);
BOOL TerminateJobObject(
HANDLE hJob, // handle to job
UINT uExitCode // exit code
);
typedef HANDLE ( __stdcall *pcre )( LPSECURITY_ATTRIBUTES, LPCTSTR );
typedef BOOL ( __stdcall *pass )( HANDLE, HANDLE );
typedef BOOL ( __stdcall *pter )( HANDLE, HANDLE );
HANDLE m_hSnapshot = NULL;
DWORD GetProcessID(char *m_cName)
{
DWORD m_dwPid = 0;
BOOL m_bStatus = false;
PROCESSENTRY32 m_ppe;
::memset( &m_ppe, 0, sizeof( PROCESSENTRY32 ) );
m_ppe.dwSize = sizeof( PROCESSENTRY32 );
__try
{
m_hSnapshot = ::CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); //创建进程快照
if ( m_hSnapshot == NULL )
{
__leave;
}
m_bStatus = ::Process32First( m_hSnapshot, &m_ppe ); //开始枚举进程
int a = ::GetLastError();
while ( m_bStatus )
{
char *current;
current = m_ppe.szExeFile;
if ( lstrcmpi( m_cName, current ) ) //忽略大小写
{
m_bStatus = ::Process32Next( m_hSnapshot, &m_ppe );
}
else
{
m_dwPid = m_ppe.th32ProcessID;
m_bStatus = false;
}
}
}
__finally
{
::CloseHandle( m_hSnapshot );
return m_dwPid;
}
}
BOOL KillJob( CString strProcessName, CString strJobName )
{
HMODULE h;
h = LoadLibrary( "kernel32.dll" );
if( h )
{
pcre cre;
pass ass;
pter ter;
cre = ( pcre )::GetProcAddress( h, "CreateJobObjectA" );
ass = ( pass )::GetProcAddress( h, "AssignProcessToJobObject" );
ter = ( pter )::GetProcAddress( h, "TerminateJobObject" );
if( !cre || !ass || !ter )
{
return FALSE;
}
//HANDLE hJob = ( HANDLE )CreateJobObject( NULL, TEXT( strJobName ) ); //建立Job对象
HANDLE hJob = ( HANDLE )cre( NULL, TEXT( strJobName ) ); //建立Job对象
DWORD dwPid = GetProcessID( ( LPTSTR )( LPCTSTR )strProcessName ); //建立QQ进程PID
HANDLE hProcess = OpenProcess( PROCESS_ALL_ACCESS, TRUE, dwPid ); //获取QQ进程句柄
if ( !hProcess )
{
AfxMessageBox( "Open process error!" );
return FALSE;
}
//AssignProcessToJobObject( hJob, hProcess ); //将进程和对象关联起来
ass( hJob, hProcess ); //将进程和对象关联起来
//BOOL bRet = TerminateJobObject( hJob, 0 ); //终止作业
BOOL bRet = ter( hJob, 0 ); //终止作业
if ( !bRet )
{
return FALSE;
}
else
{
return TRUE;
}
FreeLibrary( h );
}
else
{
return FALSE;
}
}
int main()//int argc, char* argv[] )
{
BOOL bRet = FALSE;
bRet = KillJob( "QQ.exe", "KillQQ" );
if ( bRet )
MessageBox( NULL, "QQ成功结束!", "提示", MB_OK );
return 0;
}
调试运行成功
#4
谢谢楼上!!
程序的确运行成功了
但是有个问题就是,我这个程序的目的就是想杀QQ进程,为什么一点反应都没有呢?
提示“QQ成功结束”,但实际上,QQ并没有结束啊!
这个程序没有达到我要杀进程的效果呢!
望指点
程序的确运行成功了
但是有个问题就是,我这个程序的目的就是想杀QQ进程,为什么一点反应都没有呢?
提示“QQ成功结束”,但实际上,QQ并没有结束啊!
这个程序没有达到我要杀进程的效果呢!
望指点
#5
不会吧,俺在win7 + qq2010都测试成功了。qq毫无声息的就退出了。
#6
俺用vc6 编译的。mbcs 控制台工程。
#7
的确没有任何反应,我也是VC6.0, Win32 Console Application。。。。。
是不是Kernel32.dll问题啊?
HMODULE h;
h = LoadLibrary( "kernel32.dll" );
还想问一下这两句语句是什么用?
是不是Kernel32.dll问题啊?
HMODULE h;
h = LoadLibrary( "kernel32.dll" );
还想问一下这两句语句是什么用?
#8
我在C盘拷贝了一个Kernel32.dll文件到工程文件夹,并导入了,还是没有任何反应
#9
cre = ( pcre )::GetProcAddress( h, "CreateJobObjectA" ); 这里为什么是CreateJobObjectA而不是CreateJobObject呢?
关键是我用CreateJobObjectA的时候会提示“QQ成功结束!”(实际上并没有结束)
而使用CreateJobObject的时候则完全没有任何提示。
这里我也不明白,CreateJobObjectA不是都没有定义吗??
关键是我用CreateJobObjectA的时候会提示“QQ成功结束!”(实际上并没有结束)
而使用CreateJobObject的时候则完全没有任何提示。
这里我也不明白,CreateJobObjectA不是都没有定义吗??
#10
CreateJobObject
是一个带字符串的函数,不同的工程要对应不同的版本,ansi工程对应CreateJobObjectA,unicode工程对应CreateJobObjectW,所以你用CreateJobObject是不对的。
是一个带字符串的函数,不同的工程要对应不同的版本,ansi工程对应CreateJobObjectA,unicode工程对应CreateJobObjectW,所以你用CreateJobObject是不对的。
#11
哦,明白了!
但是既然不是CreateJobObject这个问题的话,那么会是什么原因呢,我电脑上运行成功,提示“QQ成功结束!”,但实际上QQ还在呢!!
求指教! 会是哪里没注意到呢?
但是既然不是CreateJobObject这个问题的话,那么会是什么原因呢,我电脑上运行成功,提示“QQ成功结束!”,但实际上QQ还在呢!!
求指教! 会是哪里没注意到呢?
#12
把vfw.h和lib,“vfw.lib放在#endif前一行