title: Visual Studio 2012 - How to add animated GIF as Resource for usage with Direct2d
body: <p>I've written a class which is able to display an animated GIF file with Direct2D.</p>
  
  <p>Right now I'm accessing the desired GIF to display via it's FilePath like: <br></p>
  
  <pre><code>WCHAR szFileName[MAX_PATH] = "C:\\Users\\xxx\\Desktop\\xxx.gif";
  
  m_pIWICFactory-&gt;CreateDecoderFromFilename(  //My IWICImagingFactory
          szFileName,                         
          nullptr,           
          GENERIC_READ, 
          WICDecodeMetadataCacheOnLoad,
          &amp;m_pDecoder);                       //My IWICBitmapDecoder
  </code></pre>
  
  <p>I need to change this part so that the desired GIF will be loaded from the Resources of my Project.</p>
  
  <p>What I did/tried so far:</p>
  
  <p><strong>1)</strong> <br>
  - I right clicked on My Project, clicked add "Resource" <br>
  - In the popup I've selected "Import" and as Resource Type I defined "GIF"</p>
  
  <blockquote>
    <p>Which resulted in a non-buildable project cause of <a href="https://stackoverflow.com/questions/15244065/error-rc2135-in-c-project-due-to-utf-8-encoding-of-rc-file">Error RC2135 in C++ project due to UTF-8 encoding of RC file</a> 
    <br> Additionally it "destroyed" my GIF file. Opening the GIF in Notepad showed that it got converted from GIF89a to BM6(.bmp) during this process</p>
  </blockquote>
  
  <p><strong>2)</strong> <br>
  - I right clicked on My Project, clicked add "Exsisting Item" and selected my GIF <br>
  - Then i tried to add the give to the .rc file like IDR_MYGIF GIF ".\resources\xxx.gif"</p>
  
  <blockquote>
    <p>Which results in "error RC2135: file not found: .\resources\xxx.gif
    "</p>
  </blockquote>
  
  <p>So basically I need to know how I can add the GIF correctly to the Resources and how I'll be able to access it in the Code for the IWICBitmapDecoder</p>
  
  <p>Thank you for any help</p>