I have the following COM visible property in a C# class: [ComVisible] bool[] Values; I have an instance of the class in C++ and used the following code to set this property (only pseudocode) CComSafeArray<VARIANT_BOOL> values(3); values[0] = VARIANT_FALSE; values[1] = VARIANT_FALSE; HRESULT hr = instance->put_Values(values.Detach()); The last line of [...] read more
I'm using COM library and I have interface defined in .tlh file as following: _COM_SMARTPTR_TYPEDEF(IMyInterface, __uuidof(IMyInterface)); Then I create object: //1st object IMyInterfacePtr pMyInterface1; pMyInterface1.CreateInstance(CLSID_MyInterface); pMyInterface1->call_some_method(BSTR("pass example text1")); //2nd object IMyInterfacePtr pMyInterface2; pMyInterface2.CreateInstance(CLSID_MyInterface); pMyInterface2->call_some_method(BSTR("pass example text2")); Then I need to create SAFEARRAY of these objects: SAFEARRAYBOUND rgsabound[1]; rgsabound[0].cElements = 2; [...] read more
I am trying to load a C# assembly with _AppDomainPtr Load_3 method. Do you have some example since I get error: hr = 0x80131533 : A mismatch has occurred between the runtime type of the array and the sub type recorded in the metadata. Here is a snippet how do [...] read more
I have a .NET DLL that exposes a method that looks like this in C#: void TestMethod(ref TestClass[] parameter) Where TestClass is a regular C# class that has a COM-visible interface, and I'm supposed to call the method with an array with one element. I can't figure out how to [...] read more