0

I have a function in a COM dll that returns a string and takes a string.

I tried this interface, while it compiles, when called it doesn't work. Not sure how to define it?

[return: MarshalAs(UnmanagedType.HString, SafeArraySubType = VarEnum.VT_VARIANT)]
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(16)]
        object GetNextOTMOption([In] ref object[] param);
Ivan
  • 7,448
  • 14
  • 69
  • 134
  • I don't know much about UWP, but are COM methods supposed to return `HString`s in variants? What are the exact language and exact signature of your method? – Medinoc Mar 28 '17 at 13:45
  • 1
    Can you tell us what the COM DLL is? If not, can you post the IDL? (Run oleview.exe, part of the Windows SDKs, to extract the UDL.) – Michael Gunter Mar 28 '17 at 15:29
  • @ Medinoc I am not exactly sure of the language the com .dll is written in, but an educated guess is Microsoft c++. The method signature is [string GetNextOTMOption(string)] – Ivan Mar 28 '17 at 15:46
  • Pseudocode like "[string GetNextOTMOption(string)]" doesn't help much. If you can post the IDL for the entire interface, we can help you better. – Michael Gunter Mar 28 '17 at 19:59

0 Answers0