Cannot implicitly convert type 'Microsoft.Win32.SafeHandles.SafeWaitHandle' to 'System.IntPtr' RRS feed

  • Question

  •   I am now tring to modify some code developed before by someone else, and when I build it, the error message will be shown:

     'System.Threading.WaitHandle.Handle' is obsolete: 'Use the SafeWaitHandle property instead.' 

      And the source code related to this warning is:

         wo.hEvent = writeEvent.Handle;


     Then, I change it to:

                    wo.hEvent = writeEvent.SafeWaitHandle;

     However, when I try building again, some error shows:

      Cannot implicitly convert type 'Microsoft.Win32.SafeHandles.SafeWaitHandle' to 'System.IntPtr' 

     As I am still very new to C#, I do not understand that clearly...

     Can anyone gives me some help? Thanks!



    Monday, October 16, 2006 8:54 AM


All replies