tags:

views:

189

answers:

1

I am using some native methods to bind to running objects in a COM-based application. One of the methods is the CreateBindCtx, which has the following signature (from MSDN)

WINOLEAPI CreateBindCtx(DWORD reserved, LPBC FAR * ppbc)

I have defined the wrapper to be

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

But FXCop is complaining about the void return type. What should the .Net/C# data type be?

+2  A: 
[DllImport("ole32.dll")]
static extern int CreateBindCtx(uint reserved, out IBindCtx ppbc);

One of the best places for pinvoke info is PInvoke.Net

Graeme Bradbury