Ok, I may have spoken too soon about things working - wierd things are happening. I've basically got an MFC application calling a VB.NET library which calls AutoCAD. The VB.NET code does the SendCommand, and by default AutoCAD is set to be not visible (setting the AcadApplication.Visible to false). When my MFC app starts up, everything's ok, and I can load normal files with no problem. When I load one that requires the SendCommand("(command -""hatchedit""...) thing, when that SendCommand is called, the AutoCAD instance becomes visible and pops up. Not a problem - just reset the Visible flag on the AcadApplication again right after the SendCommand.
But what happens is when I load another file after that, I get an error and the AutoCAD instance goes away. The error message I get is "The object invoked has disconnected from its clients". I'm not getting them any more, but once there were message boxes saying exceptions occurred in "AcObjClassImp.arx" and "Acopm.arx".
The other wierd thing is that if I let the AutoCAD instance become visible, or start it off being visible, everything works fine. I'm wondering if there's some error or something that AutoCAD need to tell me about so it pops up.
I can put in code in my app to reconnect if it finds itself disconnected, but I'd rather figure out what I'm doing wrong here.
Edit: Also, the -hatchedit command does not seem to be able to handle hatch entities in block definitions. Bummer.
Message was edited by: jnelso99