Пример #1
0
/* Outputs the Unicode character CODE to the output stream STREAM.
   Upon failure, exit if exit_on_error is true, otherwise output a fallback
   notation.  */
void
print_unicode_char (FILE *stream, unsigned int code, int exit_on_error)
{
  unicode_to_mb (code, fwrite_success_callback,
		 exit_on_error
		 ? exit_failure_callback
		 : fallback_failure_callback,
		 stream);
}
Пример #2
0
std::string known_folder_path(const KNOWNFOLDERID& id)
{
    std::string path;
    WCHAR* buffer;
    HRESULT result = SHGetKnownFolderPath(id, 0, NULL, &buffer);
    if (result == S_OK) {
        path = unicode_to_mb(buffer);
        CoTaskMemFree(buffer);
    }
    return path;
}