I have a Problem.
I am trying to get the country name (Like 2 letter of country) But i have this trouble - Its nnot working
my code is looking Like this
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
country : String;
Temp: String;
begin
country := GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SABBREVCTRYNAME, Temp, 256);
showmessage(country);
end;
end.
But i am getting an Error
[dcc32 Error] Unit1.pas(32): E2010 Incompatible types: 'PWideChar' and 'string'
On the GetLocalInfo() Line.
Please what is wrong?