In the standalone api of SolidWorks (C#), I use ISldWorks app = (ISldWorks)Activator.CreateInstance(Type.GetTypeFromProgID("SldWorks.Application")) to create an instance, and use OpenDoc6 to open a file. In my addin program, I try to get this SolidWorks handle by using: SldWorks app = (SldWorks)System.Runtime.InteropServices.Marshal.GetActiveObject("SldWorks.Application"), but this command does not work. Please give me some advices. Thanks.
My computer: Windows 10, 64 bits, SolidWorks 2018