Passing an object from C++ to C# though COM
问题 hi have a COM visible API in C# which looks like the following: public void DoSomething(string par1, string par2, object additionalParameter) The idea is that based on the value of the string parameters I expect a different class as the third parameter and cast it appropriately in the implementation (I know this design is not optimal but I don't have much flexibility here). Suppose that for some combination of the string parameters the type of the additional parameter is the following: