C# and void pointers
I am writing my first C# application, but as luck would have it I must use void pointers (working with a DLL which returns handles). From what I read there are a few options: Unsafe code, for example see http://www.c-sharpcorner.com/UploadFile/gregory_popek/WritingUnsafeCode11102005040251AM/WritingUnsafeCode.aspx In the C# program writing in my function declerations IntPtr instead of void*. e.g.: public static extern char SupportsWhatever(IntPtr h); Using ref, e.g.: public static extern char SupportsWhatever(ref h); It should also be noted that I need to marshal information back and forth