Click here to Skip to main content
       

C / C++ / MFC

 
AnswerRe: Does anyone know this c plus plus knowledge? [modified] PinmemberJackDingler16-Jan-13 11:19 
GeneralRe: Does anyone know this c plus plus knowledge? Pingroupyu-jian16-Jan-13 17:50 
GeneralRe: Does anyone know this c plus plus knowledge? PinmemberJackDingler17-Jan-13 5:15 
Questiondeque problem. Does this code has any problem? [solved] [modified] Pingroupyu-jian14-Jan-13 3:47 
{
    CTempLock tempLock(&m_FrameListLock);
    if (m_FrameQueue.size() == 0)  return 0L;
 
    pFrameData = m_FrameQueue.front();
    m_FrameQueue.pop_front();
}
 
if (WaitForSingleObject(this->m_hCloseEvent, 0) == WAIT_OBJECT_0)
{
    return ZMD_OK;
}
 
try
{
    if (pFrameData != NULL)
    {
        if (pFrameData->lpData != NULL)
        {
            try
            {
                this->DistributeFrame(pFrameData->lpData, pFrameData->iSize);
                byte*  pBuf = reinterpret_cast<byte*>(pFrameData->lpData);
                delete[] pBuf;
            }
            catch (CException* e)
            {
                e->Delete();
            }
        }
        delete pFrameData;
        pFrameData = NULL;
    }
}
catch (CException* e)
{
    e->Delete();
}
 
}
 

There is a error that happens in the following code.
byte*  pBuf = reinterpret_cast<byte*>(pFrameData->
 
The class is here.
 
class CStreamProcess
{
    HRESULT ProcessFrames();
 
    void DistributeFrame(const LPVOID const lpBuf, int  dwSize);
 
    HANDLE  m_hCloseEvent;
    HANDLE  m_hFrameProcessEvent;
    std::deque<SZMDFrameData>   m_FrameQueue;
    CCriticalSection    m_FrameListLock;
};
 
--------------------
I have resolved this problem. Its a mistake of using CCriticalSection.

modified 15-Jan-13 3:35am.

AnswerRe: deque problem. Does this code has any problem? PinmvpCPallini14-Jan-13 6:59 
GeneralRe: deque problem. Does this code has any problem? Pingroupyu-jian14-Jan-13 13:50 
GeneralRe: deque problem. Does this code has any problem? Pingroupyu-jian14-Jan-13 16:02 
QuestionCDC Problem with coordinates PinmemberArgonia14-Jan-13 1:50 
AnswerRe: CDC Problem with coordinates PinmemberArgonia14-Jan-13 21:39 
GeneralRe: CDC Problem with coordinates PinmemberVaclav_Sal15-Jan-13 9:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.140821.2 | Last Updated 22 Aug 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid