B
boyzi
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
DllHandle = LoadLibrary("Project2.dll");
MOUSEHOOKFCT InstHook = reinterpret_cast<MOUSEHOOKFCT>
(GetProcAddress(DllHandle, "_InstallMouseHook"));
if(!InstHook())
Label1->Caption = " Íå ìîãó óñòàíîâèòü õóê ìûøè !";
else
Label1-> Caption = "Õóê ìûøè óñòàíîâëåí";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
MOUSEHOOKFCT RemHook = reinterpret_cast<MOUSEHOOKFCT>
(GetProcAddress(DllHandle, "_RemoveMouseHook"));
if(!RemHook())
Label1->Caption = " Íå ìîãó ñíÿòü õóê ìûøè ";
else
Label1->Caption = " Õóê ìûøè ñíÿò ";
FreeLibrary(DllHandle);
}
//---------------------------------------------------------------------------
[C++ Error] Unit1.cpp(19): E2451 Undefined symbol 'DllHandle'
[C++ Error] Unit1.cpp(33): E2451 Undefined symbol 'DllHandle'
???? в чём проблема ?
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
DllHandle = LoadLibrary("Project2.dll");
MOUSEHOOKFCT InstHook = reinterpret_cast<MOUSEHOOKFCT>
(GetProcAddress(DllHandle, "_InstallMouseHook"));
if(!InstHook())
Label1->Caption = " Íå ìîãó óñòàíîâèòü õóê ìûøè !";
else
Label1-> Caption = "Õóê ìûøè óñòàíîâëåí";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
MOUSEHOOKFCT RemHook = reinterpret_cast<MOUSEHOOKFCT>
(GetProcAddress(DllHandle, "_RemoveMouseHook"));
if(!RemHook())
Label1->Caption = " Íå ìîãó ñíÿòü õóê ìûøè ";
else
Label1->Caption = " Õóê ìûøè ñíÿò ";
FreeLibrary(DllHandle);
}
//---------------------------------------------------------------------------
[C++ Error] Unit1.cpp(19): E2451 Undefined symbol 'DllHandle'
[C++ Error] Unit1.cpp(33): E2451 Undefined symbol 'DllHandle'
???? в чём проблема ?