在 DirectXGame.exe 中0x00B84CD6出现未经处理的异常:0xC0000005:访问冲突读取位置0x
Unhandled exception at 0x00B84CD6 in DirectXGame.exe: 0xC0000005: Access violation reading location 0x000000DC
>C++ DirectX11 Visual Studio 2012.我已经宣布我的GKController1类为参考类。我是C++编程的新手,我没有编写大部分代码,所以我真的不明白为什么它会中断。如果你还需要代码,就问吧。谢谢。
下面是它中断的代码:
背景.cpp文件
int GameBackGround::PlayingGame()
{
if (this->controller1->IsPauseRequested()) //Breaks here, it doesn't even allow me to step into the method, it just breaks
{
//Game Paused
return 3;
}
}`
背景.h 文件
GKController1^ controller1;
//GKController1 file
bool GKController1::IsPauseRequested()
{
if (gamepadConnected)
{
if (this->gamepadState.Gamepad.wButtons & XINPUT_GAMEPAD_BACK
&& !(this->previousGamepadState.Gamepad.wButtons & XINPUT_GAMEPAD_BACK))
{
return true;
}
else
{
return false;
}
}
else
{
return this->escKeyPressed;
}
}
if (this->controller1->IsPauseRequested()) //Breaks here, it doesn't even allow me to step into the method, it just breaks
controller1
几乎可以肯定是一个糟糕的指针。 当您取消引用它(->IsPaurRequested()
)时,您会收到访问冲突,因为您正在读取不属于您的内存。
你在哪里初始化它? 我看到了声明,但您需要在某处初始化它。 该成员与声明类的类型相同。 为什么需要它? 看起来你只是把所有东西都传递了,为什么不直接使用IsPauseRequested()
(this->IsPauseRequested()
)?
相关文章:
- 在类 12.exe 中0x7B37FF80 (ucrtbased.dll) 引发异常: 0xC0000005:访问冲突读
- (此函数用于计算 SMA).在 FA.exe 中0x00509159引发异常: 0xC0000005:访问冲突读取位置0
- mystring.exe中的0x0FC9E559(ucrtbaseed.dll)的未经手法异常:0xc0000005:访
- 在2.exe中的0x00DE181818的未经手法异常:0xc0000005:访问违规写作位置0xcd7cbe10
- 在 DirectXGame.exe 中0x00B84CD6出现未经处理的异常:0xC0000005:访问冲突读取位置0x
- BunkerBuilder.exe中0x0070C75C处的首次机会异常:0xC0000005:写入位置0xCCCCC0
- 引擎.exe 0x00000000时未处理的异常: 0xC0000005:访问冲突
- main.exe 中0x779615de处未处理的异常:0xC0000005:访问违规写入位置0x003f0014
- 错误 linkedlist .exe 中0x00D0345E处的未处理异常: 0xC0000005:访问违规写入位置0x
- 首次插入静态 STL 集会导致引发未经处理的异常0xC0000005:引发访问冲突
- 程序.exe中0x010F2F1C时未处理的异常: 0xC0000005:访问冲突读取位置0xCCCCCCD0
- 第 1 章.exe中0x003860EF未处理的异常: 0xC0000005:访问违规写入位置0x0038EE7C
- opencv_helloworld.exe中0x778715de处未处理的异常:0xC0000005:读取位置0x000
- ConsoleApplication2.exe中的首次机会异常:0xC0000005:写入访问冲突,c++
- ..中0x00C87963处出现未处理的异常:0xC0000005:读取位置0xCCCCCCE0时发生访问冲突
- application.exe中0x0872340b(CAN.dll)处未处理的异常:0xC0000005:读取位置0x
- C++:xxx中0x00101890处未处理的异常:0xC0000005:读取位置0xcccccccc的访问冲突
- 模拟时钟.exe 0x00BF57F9时未处理的异常: 0xC0000005:访问冲突读取位置0x00000000
- 日志含义glBufferSubData导致未处理异常:0xC0000005
- 在0x5919c8ec (msvcr100d.dll)的第一次机会异常:0xC0000005:访问违反读取位置0xfee