File To IntPtr
The Purpose of the below class is to convert a String to IntPtr Public Class CairoIntPtr Inherits MarshalByRefObject Implements IDisposable Private _disposed As Boolean Private _handle As IntPtr Public Sub New(s As String) Dim func As Func(Of String, IntPtr) = Function(str) Dim ptr As IntPtr = CType(Nothing, IntPtr) ptr = System.Runtime.InteropServices.Marshal.StringToHGlobalUni(str) Return ptr End Function Dim zero As Func(Of IntPtr) = Function() IntPtr.Zero _handle = If(Not String.IsNullOrEmpty(s), func(s), zero) End Sub Public ReadOnly Property Handle() As Integer Get Return Me._handle End Get End Property Public ReadOnly Property ToInt32 As Int32 Get Return Convert.ToInt32(Me.Ha