title: Convert from std::string to DWORD
body: <p><br>
  I have a simple problem with a conversion:  </p>
  
  <pre><code>std::string str = "0xC0A80A02"
  </code></pre>
  
  <p>and I need to convert it to DWORD.<br>
  I searched on the web and found some solution but none seems to work.<br>
  try1:  </p>
  
  <pre><code>DWORD m_dwIP = atol(str.c_str());
  </code></pre>
  
  <p>try2:  </p>
  
  <pre><code>std::istringstream ss(str.c_str());
  ss &gt;&gt; m_dwIP;
  </code></pre>
  
  <p>try3:  </p>
  
  <pre><code>sscanf (str.c_str(),"%u",str,&amp;m_dwIP);
  </code></pre>
  
  <p>Note the string stores the value in hexa .  </p>
  
  <p>Thanks,<br>
  Gabriel</p>