Attached is a sample VS2008 C# project that uses early binding in AutoCAD 2012. It works fine. I need to be able to build this project for both 2010 & 2011, the SSM is only provided to us as a COM component the different versions are a problem. Autodesk didn't provide a DLL for the AcSmComponents18.tlb, so in order to build the earlier versions I must also build a version specific dll for this, then that dll must be distributed with the project.
In order to avoid the extra dll, I want to use late binding so no dll needed. Herein lies my problem...I've used early binding in VBA many times in the past, and have read up on using it in C#. But I'm failing miserably at getting this to work. In the attached project, Class1.cs has the working early binding code. Class2.cs has my attempts at the conversion. If anyone could chime in with something to make this work, it would be greatly appreciated.