【问题标题】:What is the C# data type for WINOLEAPI?WINOLEAPI 的 C# 数据类型是什么?
【发布时间】:2009-01-29 23:55:54
【问题描述】:

我正在使用一些本机方法来绑定到基于 COM 的应用程序中正在运行的对象。其中一种方法是 CreateBindCtx,它具有以下签名(来自 MSDN)

WINOLEAPI CreateBindCtx(DWORD reserved, LPBC FAR * ppbc)

我已将包装器定义为

public static extern void CreateBindCtx(int reserved, out IBindCtx ppbc);

但 FXCop 抱怨返回类型为 void。 .Net/C# 数据类型应该是什么?

【问题讨论】:

    标签: c# com


    【解决方案1】:
    [DllImport("ole32.dll")]
    static extern int CreateBindCtx(uint reserved, out IBindCtx ppbc);
    

    pinvoke 信息的最佳位置之一是PInvoke.Net

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-11
      • 2016-03-03
      • 1970-01-01
      • 2010-10-24
      • 1970-01-01
      • 1970-01-01
      • 2010-10-04
      • 2012-05-16
      相关资源
      最近更新 更多