Skip to content

Instantly share code, notes, and snippets.

@DamonHao
Created July 1, 2015 02:00
Show Gist options
  • Select an option

  • Save DamonHao/a4b868414d1cfd8208f1 to your computer and use it in GitHub Desktop.

Select an option

Save DamonHao/a4b868414d1cfd8208f1 to your computer and use it in GitHub Desktop.
c++ convert char* to wchar*
char* errorInfo = (char*) errorBuffer->GetBufferPointer();
const size_t cSize = strlen(errorInfo)+1;
wchar_t* wc = new wchar_t[cSize];
size_t tmp = 0;
mbstowcs_s(&tmp, wc, cSize, errorInfo, cSize);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment