同一个文件内的东西都用不成?
void __fastcall TForm1::FormCreate(TObject *Sender)
{
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
}
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
ReadProcessMemory (hProcess, (LPVOID)0xADBC80, &h, 4, NULL );
}
=========================================================
结果提示[C++ Error] Unit1.cpp(51): E2451 Undefined symbol 'hProcess '
这是怎么回事啊?
[解决办法]
TForm1的头文件中
private:
HANDLE hProcess;
——————————————————————————————————
cpp中改:
void __fastcall TForm1::FormCreate(TObject *Sender)
{
hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
}
看看