Passing HWND for C++ wrapper

  • Thread starter Thread starter Chris Ashley
  • Start date Start date
C

Chris Ashley

I am writing a Managed C++ wrapper for some unmanaged code to be used
from C#. A lot of the C++ methods expect HWND parameters - what is the
best way of passing these from C#? At the moment I am taking an IntPtr
in my wrapped methods and casting to HWND from the IntPtr.ToPointer()
method - is this the best approach?

Thanks
 
Chris said:
I am writing a Managed C++ wrapper for some unmanaged code to be used
from C#. A lot of the C++ methods expect HWND parameters - what is the
best way of passing these from C#? At the moment I am taking an IntPtr
in my wrapped methods and casting to HWND from the IntPtr.ToPointer()
method - is this the best approach?

AFIAK, that's pretty much the standard solution.

-cd
 
Back
Top