URLDownloadToFile to the same directory
<p>I am trying to achieve saving a random file from the net to the same directory where the .exe is located. The problem is that I only got it working when specifying the absolute directory.</p>

<p>The last code I tried was: </p>

<pre><code>    string home;    
    home = system("echo %HOMEDRIVE%%HOMEPATH%/aaa.gif");

  HRESULT hr = URLDownloadToFile ( NULL, _T("http://stackoverflow.com/gif.gif"), (TCHAR*)home.c_str(), 0, NULL );
</code></pre>

<p>Also I tried:</p>

<pre><code>HRESULT hr = URLDownloadToFile ( NULL, _T("http://stackoverflow.com/gif.gif"), "/aaa.gif", 0, NULL );
</code></pre>

<p>But it isn't working neither.</p>

<p>How can I sort it out? Thanks :)</p>
