Unfortunately I'm not able to get to the computer of my colleague in the next days but I tried it on a older one which has AutoCAD LT 2004 installed.
I got this exception text:
System.Runtime.InteropServices.COMException (0x800401E3): Vorgang nicht verfügbar. (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE))
at System.Runtime.InteropServices.Marshal.GetActiveObject(Guid& rclsid, IntPtr reserved, Object& ppunk)
at System.Runtime.InteropServices.Marshal.GetActiveObject(String progID)
at CADConn.CADConnection.Get_Point() in d:\work\cvs\vcc\arge\cadconn\cadconn.h:line 172
at ARGE.Form1.anAutoCADübergeben(Object sender, EventArgs e) in d:\work\cvs\vcc\arge\arge\form1.h:line 2073
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
As you might guessed I used:
acadApp=(AcadApplication)System.Runtime.InteropServices.Marshal.GetActiveObject("AutoCAD.Application");
to connect to AutoCAD2006 and now I'm looking for a possibility to connect to other versions or at least to the newer ones(since 2006)
I tried it with GetActiveObject("AutoCAD.Application.17") but I think that I need another Interface-class for this. Correct me if I'm wrong but acax16 sounds like it only works on 16-Applications like 2006.
I hope you're able to help me...
Thanks in advance