编程语言
首页 > 编程语言> > C#-.NET COM互操作方法签名

C#-.NET COM互操作方法签名

作者:互联网

对于以下COM方法,您将使用什么互操作签名?我对最后两个参数以及是否尝试将MarshalAs与SizeParamIndex一起使用特别感兴趣.

HRESULT GetOutputSetting(
  DWORD    dwOutputNum,
  LPCWSTR  pszName,
  WMT_ATTR_DATATYPE*  pType,
  BYTE*    pValue,
  WORD*    pcbLength
);

文档状态:

pValue [out] Pointer to a byte buffer containing the value. Pass NULL
to retrieve the length of the buffer
required.

pcbLength [in, out] On input, pointer to a variable containing the
length of pValue. On output, the
variable contains the number of bytes
in pValue used.

解决方法:

您可以尝试使用PInvoke Signature Toolkit.在执行平台互操作时,正确整理封送非常有用.它很可能不会涵盖您的特定问题,但是您可能会找到一个类似的问题,该问题可以为您提供所需的信息.

标签:com,interop,com-interop,c,net
来源: https://codeday.me/bug/20191210/2104057.html