Hi,

Win APIs & string passed to them as arguments are driving me crazy:


char tmp[22];
::RegQueryValue(HKEY_LOCAL_MACHINE, "x", "y", tmp);

gives me:

converting 2nd parameter from 'const char [2]' to 'LPCWSTR' not possible


and


char tmp[22];
::RegQueryValueA(HKEY_LOCAL_MACHINE, "x", "y", tmp);

converting parameter 4 from 'char [22]' to 'PLONG' not possible



Is there any reference/explanation as for all those string types?
Why cant i pass a simple "text string" to an API?

thx,