visual studio - C++ Get country code -
i'm trying country code (example: "uk" or "si" or "ger") via getgeoinfo().
geoid getusergeoid(geoclass_nation);
currently getting value 16 above function ^ looking in table there's no number 16.
https://msdn.microsoft.com/en-us/library/windows/desktop/dd374073(v=vs.85).aspx
i know it's 3-4 lines of code can't seem figure out on own. appriciated.
edit:
geoid mygeo = getusergeoid(geoclass_nation); int sizeofbuffer = getgeoinfo(mygeo, geo_iso2, null, 0, 0); wchar *buffer = new wchar[sizeofbuffer]; int result = getgeoinfo(mygeo, geo_iso2, buffer, sizeofbuffer, 0);
got display country number don't know how i'd transform iso code.
to country iso:
geoid mygeo = getusergeoid(geoclass_nation); int sizeofbuffer = getgeoinfo(mygeo, geo_iso2, null, 0, 0); wchar *buffer = new wchar[sizeofbuffer]; int result = getgeoinfo(mygeo, geo_iso2, buffer, sizeofbuffer, 0); wcout<<buffer;
thanks @christophe , @thomas.
Comments
Post a Comment