when I write the ARX project depends on the library compiled by VS2019, I use code below,it will crash on code"SetCurDocument" only on CAD 2017 and later , it works ok on CAD2016 and older.
crash tooltip: "Exception thrown at 0x00007FF77A4AD148 (in acad.exe): 0xC0000005: An access violation occurred while reading location 0x0000000000000010. "
AcApDocumentIterator *pDocItr = acDocManagerPtr()->newAcApDocumentIterator();
for (; !pDocItr->done(); pDocItr->step())
{
AcApDocument *pDoc = pDocItr->document();
acDocManager->setCurDocument(pDoc);// CAD crash on this code line ""
XXX....
}