
Untitled
By: a guest on
Jun 20th, 2012 | syntax:
None | size: 0.71 KB | hits: 10 | expires: Never
C# implemenation of IDL declaration with an INT_PTR
[id(7), helpstring("method SomeFunction")] HRESULT SomeFunction([in] INT_PTR windowHandle, [out, retval] VARIANT_BOOL* dlgResult);
public bool SomeFunction(int windowHandle)
#if WIN64
long handle;
public bool SomeFunction(long windowHandle)
#else
int handle;
public bool SomeFunction(int windowHandle)
#endif
public bool SomeFunction(IntPtr windowHandle)
{
// Implementation here.
// If you need the value of the pointer in the implementation,
// you can use:
// long actualValue = windowHandle.ToInt64();
}
long actualHandle = 1234;
IntPtr handlePtr = new IntPtr(actualHandle);
bool returnValue = SomeFunction(windowHandle);