.NET mshtml: How to pass a BSTR SAFEARRAY?

前端 未结 3 1353
孤独总比滥情好
孤独总比滥情好 2021-01-22 12:21

The class mshtml.HTMLDocumentClass in Microsoft.mshtml.dll assembly has a method:

public virtual void write(params object[] psarray);

Avoiding

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-22 12:55

    The declaration for the write method on the IHTMLDocument2 interface created by TLBIMP/VS.NET is incorrect. It should be:

    void Write([In, MarshalAs(UnmanagedType.SafeArray)] object[] psarray);
    

    You will have to define this interface in code and then use that.

提交回复
热议问题