Q&A

  • string을 widechar형으로?
안녕하세요?
string형을 widechar형으로 바꾸고 싶은데요
어떻게 해야될까여?
1  COMMENTS
  • Profile
    홍성락 2002.10.03 06:17
    hsr///////////////////////////////////////////////////////
    아래는 Pwidechar형과 widechar배열형등에 넣는 방법들입니다.
    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;
    3번
    procedure TForm1.Button1Click(Sender: TObject);
    var
        awc1 : array[0..5] of WideChar;
        str : string;
    begin
        str := '012345';
        StringTowidechar(str,@awc1,7);
        showmessage(string(awc1));
    end;