ObjectARX

Reply
New Member
tsao100
Posts: 1
Registered: ‎10-07-2004
Message 1 of 2 (95 Views)

AcArray Assertion Failed

95 Views, 1 Replies
05-23-2012 01:50 AM

Hello,

 

In myCustomEnt.h

 

class myCustomEnt: public acdbcurve{

 

public:

    void CalSomething(void);

...

private:

    AcArray<Int32> mType;

...

}

----------------------------------------------------------------------

in myCustomEnt.cpp

 

myCustomEnt::myCustomEnt(){   //Default Constructor

 

CalSomething(void);

}

 

void myCustomEnt::CalSomething(void){

  acutPrintf(_T("%d\n"), mType.length());  // mType.LogicalLength()=14 in the  initial input

  for (int i=0; i < Count; i++){   //Count = 14

       Int32 type = mType.at(i);

  }

}

 

Acad::ErrorStatus myCustomEnt:: subTransformBy(...){

CalSomething(void);

}

 

The expected output should be 14 only in the comment screen.

But, I see the output

1

2

3

...

13

14

 

Why the AcArray LogicalLength unexpected changed? This will lead the assertion failed, if NDEBUG not defined.

What should I do to avoid this assertion failure?

 

Thanks,

 

Jack

Distinguished Mentor
owenwengerd
Posts: 686
Registered: ‎08-06-2002
Message 2 of 2 (90 Views)

Re: AcArray Assertion Failed

05-23-2012 07:33 AM in reply to: tsao100

The portion of the code that you posted is not complete and will not compile. I'm not sure I understand the problem, but if the size is not what you expect, then you should determine when and why it changed.

--
Owen Wengerd
ManuSoft
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.