title: Checking for a null pointer in C#
body: <p>I am calling a C function. The function will return a handle. The handle is actually a pointer but the C# program only uses it to call other C functions. The C program will return a C NULL if there was an error. I want the C# program to check if a C NULL was returned.</p>
  
  <p>The "prototype" is as follows:</p>
  
  <pre><code>[DllImport("W:\\Dropbox\\DSI (His)\\Windows Apps\\Debug\\DsiLibrary_CSharp.dll", CharSet = CharSet.Ansi)]
  public static extern UIntPtr XBaseGetDefineFile(short fileNum);
  </code></pre>
  
  <p>The basic idea of the 'if' would be this:</p>
  
  <pre><code>if (XBaseFunctions.XBaseGetDefineFile(900) == null)
  </code></pre>
  
  <p>I have looked at lots of samples of null pointers but none discuss this topic. So I tried several ideas but to no success.</p>
  
  <p>What I need to know is how to properly construct the 'if' statement.</p>