+ -
当前位置:首页 → 问答吧 → Unhandled exception in WCAFrame.exe(KERENL32.DLL):0xE06D7363:Microsoft C++ E

Unhandled exception in WCAFrame.exe(KERENL32.DLL):0xE06D7363:Microsoft C++ E

时间:2011-11-25

来源:互联网

我用MFC写了一个缓冲:是IN和OUT的,当用WinAPI 调用这个函数时产生了如题的错误。是在In函数中,当我要将从MFC发送过来的数据In缓冲的时候发生的。请问这是怎么回事啊?是不兼容还是什么?

作者: Balana_yan   发布时间: 2011-11-25

自己顶一下

作者: Balana_yan   发布时间: 2011-11-28

只有贴代码才行。

作者: jennyvenus   发布时间: 2011-11-28

[color=#FF0000][/color]
引用 2 楼 jennyvenus 的回复:
只有贴代码才行。


if (!m_client.Connect(m_IP,m_port))
{
return 0;
}
SuspendThread(hThreadFetchingData);
SuspendThread(hThreadAnalyzing);
char* p=m_y.ReadData(0);
m_client.Send(p,10);
m_y.freeFunc(p);
char* recvBuf=new char[40];
m_client.Receive(recvBuf);


In函数为:HANDLE h[2] = {m_hInRelease, m_hSemIn};
switch (WaitForMultipleObjects(2, h, FALSE, INFINITE))
{
case WAIT_OBJECT_0:
TRACE0("in release!\r\n");
return 0;

case WAIT_OBJECT_0 + 1:
break;
}

BufElem *pElem = m_pBufElem + m_head;  
if (length > pElem->nSize)
{
delete pElem->pBuf;
pElem->pBuf = new char [length]; //就是在这个地方报的错  
}
pElem->nSize = length;
memcpy(pElem->pBuf, sMsg, length);
m_head = (m_head + 1) % m_nBufSize; //m_nBufSize的值是最大帧个数。

LONG nCount = 0;
ReleaseSemaphore(m_hSemOut, 1, &nCount);

作者: Balana_yan   发布时间: 2011-11-28

我就很奇怪,怎么会去暂用了系统的内存呢?我什么都没有动。

作者: Balana_yan   发布时间: 2011-11-28

pElem->pBuf = new char [length]; //就是在这个地方报的错  
length是多少?

作者: buyong   发布时间: 2011-11-28

BufElem *pElem = m_pBufElem + m_head;  
这个pElem有效么?

作者: buyong   发布时间: 2011-11-28