close

Delete point時,point比原來的記憶體還大,就會出現這問題

 

此範例中,swprintf會重新配置記憶體

 

        WCHAR *pDrive = new WCHAR;

       

        TRACE("size:%d", sizeof(*pDrive));

        ::swprintf(pDrive , L"%s", this->m_sCurrentDrive);

        this->m_PowerCycleThreadPara.drive  = *pDrive;

        delete pDrive;

 

 

VC 6.0 Error Msg

 

 

 

 

 

 

 

 

VC 2013 Error Msg

 

 

 

________________________________________ 3S CONFIDENTIALITY NOTICE: This message and all attachments may contain legally privileged and confidential information. Any unauthorized review, use or distribution by anyone other than the intended recipient is strictly prohibited. If you are not the intended recipient, please contact the sender immediately by replying to the message and delete all copies. Thank you.
arrow
arrow
    全站熱搜

    天才R 發表在 痞客邦 留言(0) 人氣()