c++不能使用.h头文件的函数
c++ cant use functions of .h header file
突然我无法使用我在.h头文件中编写的新函数,而我编写的旧函数我可以使用它,我简直不敢相信:S
stdafx.h
#include "function.h"
挂钩
#include "stdafx.h"
namespace DragoN_Hook
{
void EditOrginalCastleWar(int StartHour,int EndHour){
unsigned char lol[4] = {0x83, 0x7A, 0x08,(unsigned char)StartHour};
MemoryCopy((DWORD)0x00411A05,(DWORD)&lol,4);
}
}
函数.h
LPVOID MemoryCopy(DWORD destination, DWORD source, int length);
函数.cpp
LPVOID MemoryCopy(DWORD destination, DWORD source, int length)
{
DWORD oldSource = 0;
DWORD oldDestination = 0;
VirtualProtect((LPVOID)source,length,PAGE_EXECUTE_READWRITE,&oldSource);
VirtualProtect((LPVOID)destination,length,PAGE_EXECUTE_READWRITE,&oldDestination);
memcpy((void*)destination,(void*)source,length);
VirtualProtect((LPVOID)destination,length,oldDestination,&oldDestination);
VirtualProtect((LPVOID)source,length,oldSource,&oldSource);
return (LPVOID)destination;
};
错误*错误C3861:"MemoryCopy":找不到标识符*
这通常发生在编译单个文件时,而该文件不会导致重新生成预编译的标头。如果重新生成解决方案,它将重新生成标头。您也可以关闭预编译的头文件,而不必处理它。
相关文章:
- C++ gmock - 我们如何在单元测试 cpp 文件中读取/获取 cpp 文件函数的参数值
- 使用其他头文件函数的头文件
- 创建文件函数是否可以打开仅在WinObj实用程序中的全局目录下列出的设备的句柄?
- 如何指定创建文件函数获取未缓存的结果?
- 标准库头文件函数原型的实现是如何用 c++ 编写的?
- 如何将类对象作为对另一个头文件函数的引用传递
- 读取文件函数lpbuffer和字节以读取澄清
- C++ - 未定义的对多个文件函数的引用
- 使用C++的可视 Unicode 文件函数
- C 创建文件函数错误
- WinAPI 创建文件函数 2.
- 具有CREATE_ALWAYS处置的创建文件函数
- 重写c库文件函数
- 如何使用客户端调用堆栈中的地址从 PDB 检索文件/函数/行号?
- 通过头文件函数将遍历的数据从二进制搜索树加载到Vector中
- 需要帮助无法弄清楚为什么我的头文件函数声明不起作用
- 是否可以在不使用文件函数的情况下使用代码块从文件运行某些用例测试?
- 如何用c++文件函数读写8位整数单位形式的数据
- 在c++中读文件函数如何识别文本文件的结束
- 使用Windows API的c++文件函数