Some of the troublesome errors encountered while using Windows is when your application depends on the Windows Component Object Model (COM) libraries and the underlying linkages are broken or the dlls go missing or corrupted for one reason or the other.
In this post, I will show you how you can identify COM errors and fix them.
Before you read further, it is important to have a basic understanding of Microsoft COM. And you can read all about it here.
BricsCAD uses two ActiveX DLLs files to enable the COM connections. They are axbricscadapp1.dll and axbricscaddb1.dll and they reside in the BricsCAD installation folder.
When the BricsCAD COM engine is broken, it usually is because these two ActiveX DLLs did not register properly, got de-registered or somehow corrupted. There are some typical reasons how this could have happened:
- You may have installed BricsCAD using insufficient rights. Solution: ALWAYS ensure that you are logged in as an administrator with FULL rights before installing BricsCAD.
- Some other installed software with a buggy COM code can cause your COM to go haywire. For example, AutoCAD 2007 and some builds of BricsCAD V11 are known to exhibit this behavior.
- And thirdly, because you did not read this blog post of mine.
The first step is to identify this as a COM malfunction / error. This may manifest in different ways but the most common is that you will see a crash with the words Automation error in the description - like what you see below:
The above error could have been due to a user-programming bug as well. To verify that it is not, type (vlax-get-acad-object) on the command line and see what you get.
The (vlax-get-acad-object) returns the name of the host CAD application and, if you see the string IDispatch in the returned value, something is wrong with the COM. If there is no error, the returned results must look like this (see below):
Notice that there is IAcadApplication in the return string, and no IDispatch. This means COM is working fine.
Once you have confirmed that you have a screwed-up COM, the next step is to fix it by registering two ActiveX DLL files that BricsCAD users to communicate via COM.
They are called axbricscadapp1.dll and axbricscaddb1.dll and reside in the BricsCAD installation folder.
You need the regsvr32.exe utility to register these two DLL files (found in the WIndows system32 folder). To do this, start the DOS command window and change to the BricsCAD installation folder and type the following on the command line:
You will need to be logged in as an administrator with FULL rights for this to be successful.
If you get error message that look like this (above), you are not logged in as an administrator with FULL rights.
If the registration is successful, you will get messages which look like this (see below):
Once this is done, you can restart your BricsCAD and check your COM once again. Things should look good now with no errors.