AcArray Problem

AcArray Problem

Anonymous
Not applicable
505 Views
3 Replies
Message 1 of 4

AcArray Problem

Anonymous
Not applicable
In my header file, I have:

protected:
typedef AcArray AcDbEntityArray;
void GetIntersectObjects(AcDbEntityArray* entArray);


in my implementation file I have:

SomeFunc()
{
....
AcDbEntityArray* entArray=new AcDbEntityArray;
GetIntersectObjects(entArray);
....
}

void CDlgCircuits::GetIntersectObjects(AcDbEntityArray* entArray)
{
acutPrintf("\nLederhosen!");
}


Why am I getting this output, and how can I fix it?


--------------------Configuration: testarrayui - Win32
Debug--------------------
Compiling...
DlgCircuits.cpp
z:\objectarx 2000\inc\acarray.h(315) : error C2248: 'AcDbEntity::AcDbEntity'
: cannot access protected member declared in class 'AcDbEntity'
z:\objectarx 2000\inc\dbmain.h(1547) : see declaration of
'AcDbEntity::AcDbEntity'
e:\program files\microsoft visual studio\vc98\include\map(26) :
while compiling class-template member function '__thiscall AcArray
AcDbEntity,class AcArrayMemCopyReallocator
>::AcArray mCopyReallocator >(int,int)'
z:\objectarx 2000\inc\acarray.h(315) : error C2248: 'new[]' : cannot access
private member declared in class 'AcDbObject'
z:\objectarx 2000\inc\dbmain.h(1000) : see declaration of 'new[]'
e:\program files\microsoft visual studio\vc98\include\map(26) :
while compiling class-template member function '__thiscall AcArray
AcDbEntity,class AcArrayMemCopyReallocator
>::AcArray mCopyReallocator >(int,int)'
z:\objectarx 2000\inc\acarray.h(315) : error C2248: 'delete[]' : cannot
access private member declared in class 'AcDbObject'
z:\objectarx 2000\inc\dbmain.h(1001) : see declaration of 'delete[]'
e:\program files\microsoft visual studio\vc98\include\map(26) :
while compiling class-template member function '__thiscall AcArray
AcDbEntity,class AcArrayMemCopyReallocator
>::AcArray mCopyReallocator >(int,int)'
Error executing cl.exe.

dbrmjstestarrayui.arx - 3 error(s), 0 warning(s)
0 Likes
506 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Martin:

> typedef AcArray AcDbEntityArray;

Try AcArray instead. As you have it now, you're making an
array of AcDbEntity objects. 🙂
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes
Message 3 of 4

Anonymous
Not applicable
"Owen Wengerd" schrieb im Newsbeitrag
news:[email protected]...
> Martin:
>
> > typedef AcArray AcDbEntityArray;
This wont't work, because you can't access AcDbEntities copy ctor. Even ify
you could, all objects that are pushed into the array will become sliced.
>
> Try AcArray instead. As you have it now, you're making an
> array of AcDbEntity objects. 🙂

Actually this won't work either, as references have to be assigned when they
are created and can't be reassigned:-(. Therefore they don't meat the
criterias to be stored in an AcArray. But this will do it:
typedef AcArray AcDbEntityPtrArray

> --
> Owen Wengerd
> President, ManuSoft ==> http://www.manusoft.com
> VP Americas, CADLock, Inc. ==> http://www.cadlock.com
>
>
0 Likes
Message 4 of 4

Anonymous
Not applicable
That worked ,thnks
"Andreas Mueller [Autodesk]" wrote in message
news:[email protected]...
>
> "Owen Wengerd" schrieb im Newsbeitrag
> news:[email protected]...
> > Martin:
> >
> > > typedef AcArray AcDbEntityArray;
> This wont't work, because you can't access AcDbEntities copy ctor. Even
ify
> you could, all objects that are pushed into the array will become sliced.
> >
> > Try AcArray instead. As you have it now, you're making
an
> > array of AcDbEntity objects. 🙂
>
> Actually this won't work either, as references have to be assigned when
they
> are created and can't be reassigned:-(. Therefore they don't meat the
> criterias to be stored in an AcArray. But this will do it:
> typedef AcArray AcDbEntityPtrArray
>
> > --
> > Owen Wengerd
> > President, ManuSoft ==> http://www.manusoft.com
> > VP Americas, CADLock, Inc. ==> http://www.cadlock.com
> >
> >
>
>
0 Likes