0
在运行时出现“错误字符串错误字符读取错误”。而且它不能用try catch来处理,错误读取字符串的字符串 - VC++
void process(const BYTE* pBodyIndexBuffer){
m_pCoordinateMapper->MapCameraPointToDepthSpace(m_pJoints[JointType_ShoulderLeft].Position, &p);
dx = static_cast<int>(p.X + 0.5);
dy = static_cast<int>(p.Y + 0.5);
try
{
if (p.X < 500 && p.X >= 0 && p.Y <= 410 && p.Y >= 0)
{
pPoint = pBodyIndexBuffer[dx + (dy*cDepthWidth)];
while (1) {
if (pPoint == 0xff) break;
pPoint = pBodyIndexBuffer[dx + (dy * cDepthWidth)];
dx -= 1;
dy -= 1;
p.X -= 1;
p.Y -= 1;
OutputDebugString(L"Moved \n");
}
}
m_pBodyEdgeswidth[ShoulderLeft] = getDistance(m_pJoints[JointType_ShoulderLeft].Position, p, distance);
}
catch (const std::exception&)
{
OutputDebugString(L"Error Occured");
}
}
我提供了代码的一部分。 这里是我所面临的问题,
请解释如何解决这个问题。
但有时它开始运行没有错误。 我怎么过去了,
BYTE *bodyIndex = NULL;
cm->getBodyIndexStream(&bodyIndex);
if(bodyIndex) process(bodyIndex);
在此先感谢。