title: Creating a bitmap from char* buffer MFC
body: <p>I'm working with an unsigned char *buffer that contains an image (16bit grayscale). I'm attempting to load this buffer into a HBITMAP so that I can use SetBitmap on a picture box control to show a live stream of images in memory.</p>
  
  <p>I've tried this so far:</p>
  
  <pre><code>HBITMAP memBMP;
  memBMP = CreateBitmap(1080,1280,1,16,pBuf);
  mPictureBox1.SetBitmap(memBMP);
  </code></pre>
  
  <p>Unfortunately the dialog box goes blank for a brief moment and then displays the buttons and elements again after iterating through all the images in memeory. Any suggestions would be much appreciated; I tried exhausting my google resources, but I couldn't find a clearcut example of how to do this.</p>
  
  <p>Thanks!</p>