Well, I believe the life of the objects will be until the array is cleared, here is the problem:
I am creating a title block entity for my drawing, I have sub-entities such as information tables. I add two tables to the title block, but when worldDraw(...) is called, I notice that both elements in the array have the same properties although I specifically set them differently:
[code]
void CMainUI::InitDrawing()
{
acDocManager->lockDocument(curDoc(), AcAp::kWrite);
Setup();
AcDbObjectPointer pTitleBlock;
if(pTitleBlock.create() == Acad::eOk)
{
AcDbObjectId objId = AcDbObjectId::kNull;
if(DocVars.docData().PostToDatabase(objId, pTitleBlock) != Acad::eOk)
{
::AfxMessageBox(_T("Error occured attempting to create title block!"), MB_OK|MB_ICONSTOP);
return;
}
DocVars.docData().SetTitleBlockId(objId);
AcDbExtents ext;
ext.set(AcGePoint3d(0.125, 0.125, 0), AcGePoint3d(2.5625, 0.875,0));
pTitleBlock->AddInfoTable(_T("Strands"), ext);
ext.set(AcGePoint3d(2.5625, 0.125,0), AcGePoint3d(6.625, 1.625, 0));
pTitleBlock->AddInfoTable(_T("Hardware"), ext);
ext = pTitleBlock->GetPageExtents();
ZoomExtents(ext);
}
acDocManager->unlockDocument(curDoc());
}
// Here is the AddInfoTable(...)
int CTitleBlock::AddInfoTable(const AcString& acsIdentifier, const AcDbExtents& ext)
{
AcDbObjectPointer pTable;
if(pTable.create() == Acad::eOk)
{
pTable->SetExtents(ext);
pTable->SetIdentifier(acsIdentifier);
m_infoTables.append(pTable);
}
return m_infoTables.length() - 1;
}
[/code]
Any ideas or suggestions?
Mike B