title: Array of structures CLI
body: <pre><code>public value struct ListOfWindows
  {
   HWND hWindow;
   int winID;
   String^ capName;
  };
  </code></pre>
  
  <p>thats my structure now i have created an array of them:</p>
  
  <pre><code>array&lt;ListOfWindows ^&gt; ^ MyArray =  gcnew array&lt;ListOfWindows ^&gt;(5);
  </code></pre>
  
  <p>now to test if that works i made a simple function:</p>
  
  <pre><code>void AddStruct( )
  {
    HWND temp = ::FindWindow( NULL, "Test" );
    if( temp == NULL ) return;
    MyArray[0]-&gt;hWindow = temp; // debug time error..
  
    return;
  }
  </code></pre>
  
  <p>ERROR: <code>An unhandled exception of type 'System.NullReferenceException' occurred in Window.exe</code></p>
  
  <pre><code>Additional information: Object reference not set to an instance of an object.
  </code></pre>
  
  <p>dont know what to do.. kinda new to CLI so if you can help please do..
  Thanks.</p>