Can't compile ActiveX DLL for v8

I am currently converting some Autocad VB and VBA code to run on v8 and I have to say Bricscad have done a great job of making v8 compatible with Autocad. However I have an ActiveX DLL created in VB6 which I can't get to compile for Bricscad. For fault finding purposes I have created a new ActiveX DLL project with just an empty class and a module. The project has references set to the Bricscad App and Bricscad DB type libraries. The module contains the following code:Sub Main() Dim dwg As AcadDocument Set dwg = ActiveDocumentEnd SubWhen I try to compile it I get the error message "Compile error: Permission denied" and "ActiveDocument" in the second line is highlighted. After this there is an instance of bricscad.exe running in the background, but not visible.Any ideas on how I can get this to compile?I'm using v8.0.14.Ray Greene

Comments

  • Hi,This works for me.Regards,Israel------Dim appBricscad as AcadApplicationDim docBricscad as AcadDocument------' Attach Bricscad Set appBricscad = GetObject(, "BricscadApp.AcadApplication") If Err Then ' If not active, new session Err.Clear Set appBricscad = CreateObject("BricscadApp.AcadApplication") If Err Then MsgBox Err.Description End End If End If appBricscad.Visible = True AppActivate CadApp.Caption Set docBricscad = appBricscad.ActiveDocument------

This discussion has been closed.