Convert HWND to IntPtr (CLI)
问题 I have a HWND in my C++ MFC code, and I want to pass this HWND to a C# control and get it as IntPtr. What Is wrong in my code, and how can I do it correctly? (I think it's something with wrong using of the CLI pointers, because I get an error that it cannot convert from System::IntPtr^ to System::IntPtr. But I don't know how exactly to make it all to work properly...) My C++ MFC code: HWND myHandle= this->GetSafeHwnd(); m_CLIDialog->UpdateHandle(myHandle); My C# code: public void UpdateHandle