>>787, >>791
  MultiByteToWideChar(CP_ACP, 0, stdstr.c_str(), -1, wcstring, sizeof(wcstring));
を
  const char* cstring = stdstr.c_str();
  MultiByteToWideChar(CP_ACP, 0, cstring, -1, wcstring, sizeof(wcstring));
にする理解力/応用力すら無いならプログラム書くのは諦めた方が良い。