DLL里写HOOK
来源:百度知道 编辑:UC知道 时间:2024/09/20 14:36:52
这是什么错误啊???????????
Build
[C++ Error] Unit1.cpp(40): E2034 Cannot convert 'long (*)(int,unsigned int,long)' to 'int (*)()'
[C++ Error] Unit1.cpp(40): E2342 Type mismatch in parameter 'lpfn' (wanted 'int (*)()', got 'long (*)(int,unsigned int,long)')
程序:
LRESULT CALLBACK KeyboardProc(int nCode,WPARAM wParam,LPARAM lParam)
{
return 1;
}
void _declspec(dllexport) _stdcall SetHook()
{
SetWindowsHookEx(WH_KEYBOARD,KeyboardProc,::GetModuleHandle(TEXT("DLL.dll")),0);
}
#include <vcl.h>
#include <windows.h>
#pragma hdrstop
#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
return 1;
}
LRESULT CALLBACK KeyboardProc(int nCode,WPARAM wParam,LPARAM lParam)
{
return 1;
}
void _declspec(dllexport) _stdcall SetHook()
{
SetWindows
Build
[C++ Error] Unit1.cpp(40): E2034 Cannot convert 'long (*)(int,unsigned int,long)' to 'int (*)()'
[C++ Error] Unit1.cpp(40): E2342 Type mismatch in parameter 'lpfn' (wanted 'int (*)()', got 'long (*)(int,unsigned int,long)')
程序:
LRESULT CALLBACK KeyboardProc(int nCode,WPARAM wParam,LPARAM lParam)
{
return 1;
}
void _declspec(dllexport) _stdcall SetHook()
{
SetWindowsHookEx(WH_KEYBOARD,KeyboardProc,::GetModuleHandle(TEXT("DLL.dll")),0);
}
#include <vcl.h>
#include <windows.h>
#pragma hdrstop
#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
return 1;
}
LRESULT CALLBACK KeyboardProc(int nCode,WPARAM wParam,LPARAM lParam)
{
return 1;
}
void _declspec(dllexport) _stdcall SetHook()
{
SetWindows
我编译了,没有错误啊。
是不是你还写了其他的钩子?
貌似是个回调函数声明错误的问题……
----------------------------------------
还是没有错误,不过我用的是VC++6.0编译
你Unit1.cpp的第40行是什么代码?把第35-45行的代码贴出来看下。看上去像是GetProcAddress调用的错误
HOOK.DLL是什么东西?
为什么HOOK。DLL不能改名
无法加载hook.dll文件
运行时出错!错误信息:无法找到指定DLL库文件HOOK.dll中的输出命令HOOk
hook.dll和new.sys这是什么病毒?
怎么能去除Hook.dll感染的病毒?
为什么传世私服不能运行,hook.dll是什么意思啊
上网后不久就自动弹出“无法找到指定DLL库文件Hook.dll中的输出命令Hook”
开机显示“运行时出错”错误信息是无法找到指定DLL库文件“HOOK,DLL”中的输出命令“HOOK”
开机后运行时出错,无法找到指定的“hook.dll”中的输出命令“hook”请问要怎么解决?谢谢!