procedure TForm1.Button1Click(Sender: TObject);
var
awc1 : array[0..5] of WideChar;
awc2 : array[0..5] of WideChar;
str : string;
begin
str := '012345';
StringTowidechar(str,@awc1,7);
showmessage(string(awc1));
StringTowidechar(string(awc1),@awc2,7);
showmessage(string(awc2));
end;
-------------------------------------------------------------
예제로는 아래 참조하시구요, 관련함수들도 도움말에 있습니다.
strPcopy나 strcopy등...
1번
procedure TForm1.Button1Click(Sender: TObject);
var
s : String;
p : Pwidechar;
i : integer;
begin
s := '12345';
GetMem(P, 256);
StringTowidechar(s,p,length(s)+1);
//i := lstrlenW(p); //길이
i := StrToint(string(p));
showmessage(intToStr(i));
showmessage(string(p));
end;
2번
procedure TForm1.Button1Click(Sender: TObject);
var
s : String;
p : Pwidechar;
Buffer: array[0..256] of widechar;
i : integer;
begin
s := '12345';
P := StringTowidechar(s,Buffer,length(s)+1);
i := StrToint(string(p));
showmessage(intToStr(i));
showmessage(string(p));
showmessage(string(Buffer));
end;
안녕하세요? widechar형으로 선언된 두개의 배열이 있는데요 예를 들어 awc1 : = array[0..5] of WideChar; awc2 : = array[0..5] of WideChar; 이렇게 있을때 awc1에다 awc2의 값을 넣고 싶거든여.. 아니면 string값을 awc1에 저장할수 ...
StringTowidechar함수를 사용해보세요
procedure TForm1.Button1Click(Sender: TObject);
var
awc1 : array[0..5] of WideChar;
awc2 : array[0..5] of WideChar;
str : string;
begin
str := '012345';
StringTowidechar(str,@awc1,7);
showmessage(string(awc1));
StringTowidechar(string(awc1),@awc2,7);
showmessage(string(awc2));
end;
-------------------------------------------------------------
예제로는 아래 참조하시구요, 관련함수들도 도움말에 있습니다.
strPcopy나 strcopy등...
1번
procedure TForm1.Button1Click(Sender: TObject);
var
s : String;
p : Pwidechar;
i : integer;
begin
s := '12345';
GetMem(P, 256);
StringTowidechar(s,p,length(s)+1);
//i := lstrlenW(p); //길이
i := StrToint(string(p));
showmessage(intToStr(i));
showmessage(string(p));
end;
2번
procedure TForm1.Button1Click(Sender: TObject);
var
s : String;
p : Pwidechar;
Buffer: array[0..256] of widechar;
i : integer;
begin
s := '12345';
P := StringTowidechar(s,Buffer,length(s)+1);
i := StrToint(string(p));
showmessage(intToStr(i));
showmessage(string(p));
showmessage(string(Buffer));
end;