GetUserDefaultLocaleName() API is crashing
        Posted  
        
            by Santhosha
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Santhosha
        
        
        
        Published on 2010-02-04T08:30:10Z
        Indexed on 
            2010/03/20
            19:21 UTC
        
        
        Read the original article
        Hit count: 1648
        
I have one application which reads user default locale in Windows Vista and above. When i tried calling the API for getting User default Locale API is crashing. Below is the code, It will be helpfull if any points the reason
#include <iostream>
#include <WinNls.h> 
#include <Windows.h>
int main()
{
    LPWSTR lpLocaleName=NULL;
    cout << "Calling GetUserDefaultLocaleName";
    int ret = GetUserDefaultLocaleName(lpLocaleName, LOCALE_NAME_MAX_LENGTH);
    cout << lpLocaleName<<endl;
}
© Stack Overflow or respective owner