your code works fine, BUT...
when it was done 86%, I got a message, that I have not enough memory to complete task.
So, I think that your computer is not good enough for this task such as my 🙂
PS: I didn't got a fatal error at all
AcApDocument * pDoc = acDocManager->mdiActiveDocument();
acDocManager->lockDocument(pDoc);
acedSetStatusBarProgressMeter(_T("Press ESC to abort: "), 0, 1500);
for(long m=0L; m<1500L; m++)
{
for(long j=0L; j<2000L; j++)
{
AcDbText *pText = new AcDbText(AcGePoint3d(m*100,j*100,0), _T("abc"));
pText->setColorIndex(1);
if(AddToModelSpace(pText)==FALSE)
{
if(pText != NULL)
delete pText;
}
}
acedSetStatusBarProgressMeterPos( m );
if(acad_abortCycle(_T("\nINFO: aborted...")) == 1)
break;
}
acedRestoreStatusBar();
acDocManager->unlockDocument(pDoc);
int acad_abortCycle(const ACHAR * abortString)
{
int res = 0;
CWinApp *app = acedGetAcadWinApp();
CWnd *wnd = app->GetMainWnd ();
MSG msg;
while (:: PeekMessage (&msg, wnd->m_hWnd, 0, 0, PM_NOREMOVE))
{
if (!app->PumpMessage())
{
:: PostQuitMessage(0);
break;
}
}
LONG lIdle = 0;
while (app->OnIdle (lIdle++));
res = acedUsrBrk();
if(res == 1 && abortString != NULL) acutPrintf(abortString);
return res;
}