TheSwamp
Code Red => .NET => Topic started by: Bryco on October 05, 2021, 08:21:04 PM
-
Code that works on acad 2019 & 2021 is crashing on db.UpdateExt(true);
Has anyone had that problem?
Using vs 2017 community and references from 2019 objectarx
-
[CommandMethod("k")]
public static void tester()
{
Document doc = acadApp.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
db.UpdateExt(false);
}
Crashes on 2022 whether set to false or true.
-
Hi,
It works as expected for me, compiled with VS2019 which is the recommended version for A2022, see this topic:
https://help.autodesk.com/view/OARX/2022/ENU/?guid=GUID-450FD531-B6F6-4BAE-9A8C-8230AAC48CB4
-
Ty Gile, it's weird that almost everything was working using the 2019 references and 2017vs. I guess it is time to update.
-
[DllImport("user32.dll")]
private static extern int GetForegroundWindow();
[DllImport("user32.dll")]
private static int GetForegroundWindow();
I think the 32 bit part of the .dll is a problem. I have used these in a sub to turn caps on when returning to Cad. When I commented these out both the VS2019 and VS2017 worked without crashing. I guess the forground window is fired when calling db.UpdateExt(false). Perhaps the crash was a windows crash and so no warning