   Using command line arguments
  I want to use command line arguments in my program, however having looked around I cant see any reasonable way to do so(ie I could write my own string parser and so on, but doing so would take hours and must have been done before...).Ideally I want to populate some kind of structure complete with default values which other parts of my program can easily pull data from.Eg say I only wanted to show the fps if -fps was provided, I want to test for that with a simple function call://render fps in top right corner if -fps was set.if(CmdArgIsSet("fps"))    Grf->DrawText(WindowSize.w - 10, 10, MakeString(fps), ALIGN_RIGHT);I searched around on google but I only found info for the "int main ( int argc, char *argv[] )" but not the WinMain one which doesnt already split the command line arguments up, which having looked at how quotes and stuff should be handled, does not appear to be a simple task either...I assume there is some library that can take that string (or the argc and argv counterpart) and provide a more useful interface to handeling them, however Ive been unable to find one on google :(   
  Doesn't your WinMain look something like this?int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int nCmdShow)If that's the case I would check szCmdLine (or whatever you name it) for your arguments.   ;  boost::program_options has a function to split the WinMain command line for you: split_winmain().   ;  And even better it seems to have a bunch of stuff for going the next step and generating a useful data structure (ie a map) from the split arguments :)Shame that it doesn't come up on google unless your looking for it (eg I was trying stuff like "c++ win32 command line parsing" and boost is nowhere to be seen...) since it seems to do everything (and more) that I want.   ;  For some reason I'm getting a compile error in lexical_cast.hpp, however I cant see what I'm doing to cause it... I narrowed it down to the std::wstring value.visibleOptions.add_options()("help",    "Help on avaiable options")("fps","Display the current fps")("nointro", "Skip the intro screens")("gameinfo",po::wvalue<std::wstring>()->default_value(L"data/game.ini"),"Location of global game data file, default is data/game.ini");And the errors1>c:\lib\c++\boost\boost\lexical_cast.hpp(764) : error C2039: 'setg' : is not a member of 'boost::detail::lexical_stream_limited_src<CharT,Base,Traits>'1>   with1>   [1>  CharT=char_type,1>  Base=base,1>  Traits=traits1>   ]1>   c:\lib\c++\boost\boost\lexical_cast.hpp(1151) : see reference to function template instantiation 'bool boost::detail::lexical_stream_limited_src<CharT,Base,Traits>::operator >><Target>(InputStreamable &)' being compiled1>   with1>   [1>  CharT=char_type,1>  Base=base,1>  Traits=traits,1>  Target=std::string,1>  InputStreamable=std::string1>   ]1>   c:\lib\c++\boost\boost\lexical_cast.hpp(1177) : see reference to function template instantiation 'Target boost::detail::lexical_cast<Target,src,false,char_type>(const std::basic_string<_Elem,_Traits,_Ax> &,CharT *,size_t)' being compiled1>   with1>   [1>  Target=std::string,1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>,1>  _Ax=std::allocator<wchar_t>,1>  CharT=char_type1>   ]1>   c:\lib\c++\boost\boost\program_options\value_semantic.hpp(190) : see reference to function template instantiation 'Target boost::lexical_cast<std::string,T>(const Source &)' being compiled1>   with1>   [1>  Target=std::string,1>  T=std::wstring,1>  Source=std::wstring1>   ]1>   c:\lib\c++\boost\boost\program_options\value_semantic.hpp(188) : while compiling class template member function 'boost::program_options::typed_value<T,charT> *boost::program_options::typed_value<T,charT>::default_value(const T &)'1>   with1>   [1>  T=std::wstring,1>  charT=wchar_t1>   ]1>   c:\projects\fl_lib\apps\asteroid defender\trunk\src\settings.cpp(23) : see reference to class template instantiation 'boost::program_options::typed_value<T,charT>' being compiled1>   with1>   [1>  T=std::wstring,1>  charT=wchar_t1>   ]1>c:\lib\c++\boost\boost\lexical_cast.hpp(765) : error C2664: 'std::basic_istream<_Elem,_Traits>::basic_istream(std::basic_streambuf<_Elem,_Traits> *,bool)' : cannot convert parameter 1 from 'base *' to 'std::basic_streambuf<_Elem,_Traits> *'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast1>c:\lib\c++\boost\boost\lexical_cast.hpp(771) : error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)1>   c:\projects\fl_lib\fllib\trunk\include\fl_lib\utill\ini.h(97): could be 'std::wistream &fllib::operator >>(std::wistream &,fllib::Ini &)'1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(155): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(std::basic_istream<_Elem,_Traits> &(__cdecl *)(std::basic_istream<_Elem,_Traits> &))'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(161): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(std::basic_ios<_Elem,_Traits> &(__cdecl *)(std::basic_ios<_Elem,_Traits> &))'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(168): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(std::ios_base &(__cdecl *)(std::ios_base &))'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(175): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(std::_Bool &)'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(194): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(short &)'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(228): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(unsigned short &)'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(247): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(int &)'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(273): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(unsigned int &)'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(291): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(long &)'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(309): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(__w64 unsigned long &)'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(329): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(__int64 &)'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(348): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(unsigned __int64 &)'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(367): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(float &)'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(386): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(double &)'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(404): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(long double &)'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(422): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(void *&)'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   c:\apps\microsoft visual studio 9.0\vc\include\istream(441): or  'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(std::basic_streambuf<_Elem,_Traits> *)'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]1>   while trying to match the argument list '(std::basic_istream<_Elem,_Traits>, std::string)'1>   with1>   [1>  _Elem=wchar_t,1>  _Traits=std::char_traits<wchar_t>1>   ]