title: Using FillRect() in C++
body: <p>I am new to using Graphics in Visual C++. I am just trying to make a rectangle filled with a color. Need help to correct this... </p>
  
  <pre><code>RECT rect;
  HDC hdc;
  hdc=CreateDC(TEXT("DISPLAY"),NULL,NULL,NULL);
  rect.left=30;
  rect.right=100;
  rect.top=50;
  rect.bottom=200;
  FillRect(hdc,&amp;rect,(HBRUSH)(RGB(40,151,151)));
  </code></pre>
  
  <p>The error is:</p>
  
  <p><code>ERROR: The variable 'rect' is being used without being initialized.</code></p>