WorkingDatabase returns NULL in 2025 version
I have a lot of problems with version 2025. If I click on a dwg file in explorer it automatically openes BricsCAD and load with my plugin. If I instead select the file in BricsCAD it crasch. When I run it in debugmode I see that it crasch first time it tries to do:
acdbHostApplicationServices()->workingDatabase();
This returns NULL! So this is a big issue.
UPDATE
I could see that it is related to the AcDbObject::dwgInFields(pFiler);
When I load data and tries to access the database to store it, it crasch. By removing the calles to the database here it loaded, but how can I load anything anymore if I can't store it to the database?
I also get this message when I open drawing. Never seen it before.
Object improperly read
AcDbAssocGeomDependency(2048D)
Comments
-
It is perfectly normal to have no working database, e.g. during zero document state. During filing, it is common to use either the filer database or the database of the filed object, for database operations.
0 -
This has worked in all previous versions and also in AutoCAD for the last 20 years without issue so to change it I need to rewrite a lot of code. What to use instead of acdbHostApplicationServices()->workingDatabase(); to fill it while loading the objects?
It is also were different depending on how I open a drawing. If I click on it in windows explorer so it autoload BricsCAD, when it WORKS, but if I open it from inside BricsCAD it fails.
UPDATE
When I run in debug I can see what when I start BricsCAD by clicking on a dwg file it first goes to the part that creates the dictionary and after that to the dwgInFields routine.
When I open a file after BricsCAD is loaded it's the opposite (first load, second create dictionary) so that's why it crash.0