int main (int argc, char* argv[]) { //if (argc != 2) { // fprintf (stderr, "SYNTAX: UUIDGEN <number-of-GUIDs-to-generate>\n"); // return 1; //} count = 1;//atoi (argv[1]); for (i = 0; i < count; i++) { CoCreateGuid (&guid); OLECHAR* bstrGuid; StringFromCLSID(guid, &bstrGuid); std::wstring ws(bstrGuid); wprintf(L"%s\n", ws.c_str()); std::string s = WideToNarrow(ws); printf("%s\n", s.c_str()); } return 0; }
inline std::string Utf8ToNarrow(const char* u8_sz) { return WideToNarrow(Utf8ToWide(u8_sz)); }