怎么原来arx2002下都很正常的代码,放到vs2005下就老报告内存错误??示例代码如下: ArxDbgSelSet ss; ads_name ent,sset; ss.setAllowSingleOnly(true,false); AcDbObject openObj; if (ArxDbgSelSet::kSelected!=ss.userSelect(L"请选择绿框",NULL,acutBuildList(-4,L"<AND",8,L"绿框",RTDXF0,L"LWPOLYLINE",-4,L"AND>",RTNONE))) { break; } ss.asAdsName(sset); acedSSName(sset, 0, ent); acdbGetObjectId(objId, ent); AcDbEntity* pEnt=(AcDbCurve*)openObj.Open(objId,AcDb::kForRead); struct resbuf * m_XData;=acutNewRb(AcDb::kDxfRegAppName); m_XData->resval.rstring = (TCHAR*) malloc(wcslen(L"sdfsdf") + 1); wcscpy(m_tmpXData->resval.rstring, L"sdfsdf"); pEnt->setXData(m_XData); pEnt->setColorIndex(ArxDbgUtils::kBlue); if (NULL != m_XData) acutRelRb(m_XData); //就是这里,为什么释放了要报告什么00....5写错误,不释放的话又要报告0...4写错误 } } 请各位高手帮忙!!!!为什么我释放和不释放都要报告内存写错误???? |