hi,
the error message explains it :
the function expexts you tp pass an argument of type LPWSTR but you are passing it a char.
so please convert the ip[16] to LPWSTR and it should work.
The function
mbstowcs[
^] can help you out.
a rough example :
char *mychar;
size_t nSize1 = 1 + strlen( mychar );
LPWSTR wUserName = new WCHAR[nSize1];
mbstowcs( wUserName, mychar, nSize1 );
delete []wUserName;
Check out this
msdn link[
^] for mbstowcs.
hope this helps !!
i dont know your whole code, this is all just hit and trial
char ip[16];
size_t nSize1 = 1 + strlen( ip );
LPWSTR wIPName = new WCHAR[nSize1];
mbstowcs( wIPName, ip, nSize1 );
GetPrivateProfileString(L"Server", L"IP", L"127.0.0.1", wIPName, _countof(ip),gamepath.c_str());
delete []wIPName;