jjzjj

HandleRef

全部标签

c# - 使用 : HandleRef or IntPtr (newer source code from Microsoft no longer uses HandleRef) 哪个更好/更安全

例如,在旧的.NETFramework2.0源代码(Windows窗体、VisualStudio2005-Whidbey)中,GetClientRect函数是使用HandleRef定义的:[DllImport(ExternDll.User32,ExactSpelling=true,CharSet=CharSet.Auto)]publicstaticexternboolGetClientRect(HandleRefhWnd,[In,Out]refNativeMethods.RECTrect);在新的WindowsAPI代码包(来自Microsoft,2009/2010)中,使用IntPt