Message 1 of 6
Acad version - interop problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
Please consider the following code:
public static object openAutoCAD(string AcadVersion)
{
object acadApp = null;
object[] parameters;
object cmd = null;
string progID = "AutoCAD.Application." + AcadVersion;
// try to open an existing instance
try
{
acadApp = (object)Marshal.GetActiveObject(progID);//exception
}
catch // if not successful try to start a new instance
...............The above code works fine when the function parameter is 17.1 (V2008) or 18.2 (V2012).
It fails with "co_e_classstring exception" when passed 16.0 (V2004).
The program is compiled with VS 2008/NET 3.5.
The passed Acad version is of course up and running prior to the function call.
The Acad version should make no differrence and yet we get an exception on V2004.
Any explanation/help will be greatly appreciated.
Thanks
alex

