AutoCAD 2013 plugin compatibility with AutoCAD 2019

AutoCAD 2013 plugin compatibility with AutoCAD 2019

EMD1954
Advocate Advocate
1,273 Views
7 Replies
Message 1 of 8

AutoCAD 2013 plugin compatibility with AutoCAD 2019

EMD1954
Advocate
Advocate

acedCommandS(RTSTR, _T("LAYER"), RTSTR, _T("T"), RTSTR, csLayer, RTSTR, NULL, RTNONE);

csLayer is a CString.  This line causes AutoCad 2019 to crash.

Any ideas?

0 Likes
Accepted solutions (2)
1,274 Views
7 Replies
Replies (7)
Message 2 of 8

EMD1954
Advocate
Advocate

Sorry - please disregard the "title".  It's just acedCommandS()

0 Likes
Message 3 of 8

Alexander.Rivilis
Mentor
Mentor
Accepted solution
acedCommandS(RTSTR, _T("_LAYER"), RTSTR, _T("_Make"), RTSTR, LPCTSTR(csLayer), RTSTR, _T(""), RTNONE);

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 4 of 8

EMD1954
Advocate
Advocate
Accepted solution

Alexander,

Thank you.  I have been doing it that way for more than 10 years and it worked in every previous version.  Without you telling me, how would I have ever found it.

Best,

Ed

0 Likes
Message 5 of 8

Alexander.Rivilis
Mentor
Mentor

@EMD1954 wrote:

Alexander,

Thank you.  I have been doing it that way for more than 10 years and it worked in every previous version.  Without you telling me, how would I have ever found it.

Best,

Ed


Your code is completely incorrect:

1. NULL after RTSTR can produce Fatal Error

2. csLayer may have other pointer than LPCTSTR(csLayer)

3. Option _SET (e.g "T") can be used only if layer previously  created, but "_Make" create and set layer current.

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 6 of 8

EMD1954
Advocate
Advocate

Yes, now I understand.  But for the record, it worked that way in Autocad 2010, 2012, 2015 and 2017 without any problems. 

 

Thank you - problem solved.

Ed

0 Likes
Message 7 of 8

autodaug
Autodesk
Autodesk

Fwiw, I see from an internal bug report that this crash was noticed in 2019 and is being looked at. Probably it was just an accident that the "incorrect" code (RTSTR followed by null) worked (or at least didn't crash) prior to 2019. And then some changes to AutoCAD's command handling implementation caused the code to suddenly start crashing in 2019, as an unintended side effect.

 

 

0 Likes
Message 8 of 8

EMD1954
Advocate
Advocate

Thank you.  I knew I wasn't crazy!

0 Likes