How to Convert char* to LPWSTR in VC++ ?
LPNETRESOURCEW nr = NULL;
memset(&nr, 0, sizeof (NETRESOURCE));
nr->lpLocalName = strDriveLetter.GetBuffer(strDriveLetter.GetLength()); // this line giving me error "Cannot Convert char* to LPWSTR"
Any help is appreciated. Thanks.
Use
MultiByteToWideChar
function;memset(&nr, 0, sizeof (NETRESOURCE));
here nr is a NULL pointer. This is not correct. You should have nr point to a valid memory first by either using explicit allocation likenew
or on allocate on stack.