I have a number of projects in the VS solution.
One is a Library of various functions, classes etc. which is used by other projects.
One is a library of my own controls
One is the exe file
One is a class which wraps around loading AutoCad's different versions. It uses Com to load a hidden version of AutoCad. It also provides a way for the exe file to know of changes inside AutoCad.
and
One is an independant class that loads as an inprocess class. It provides various functions such as reading title sheets, as well as block and layer manipulation. It effectively adds my Commands to AutoCad.
Following your advice, the function that reads title sheets does this using the database and not the editor. It now (thankyou) works faultlessly when called inside AutoCad.
But if I invoke it from my exe. I get this error:-
Autodesk.AutoCAD.Runtime.Exception: eFileSharingViolation at Autodesk.AutoCAD.DatabaseServices.Database.ReadDwgFile(String fileName, FileOpenMode mode, Boolean allowCPConversion, String password) at om2011net.clsAcad.OMREADTITLES() in D:\Visual Studio 2008\Projects\Acadnet2011\clsAcad.vb:line 374 at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction) at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction) at Autodesk.AutoCAD.Runtime.PerDocumentCommandClass.Invoke(MethodInfo mi, Boolean bLispFunction) at Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke()
Furthermore, nothing was written to an external file, so it hasn't even got into the routine.