Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 Q&A
Delphi Programming Q&A
[13129] 유니코드 관련 에러 도와 주세요
미모아 [] 1902 읽음    2010-02-16 00:09
실은 델파이는 오늘 거의 처음봤습니다.-_-
소스컴파일이 필요해서 2010깔아서 컴파일을 하는데 아니나 다를까 경고,에러가 발생하네요
포럼을 뒤진결과 유니코드 관련 에러입니다.
function CreateFileX(fileName: PWideChar; write, create: boolean) : dword;
var c1, c2, c3 : dword;
begin
  if write then begin
    c1 := GENERIC_READ or GENERIC_WRITE;
    c2 := 0;
  end else begin
    c1 := GENERIC_READ;
    c2 := FILE_SHARE_READ or FILE_SHARE_WRITE;
  end;
  if create then c3 := CREATE_ALWAYS
  else           c3 := OPEN_EXISTING;
  if GetVersion and $80000000 = 0 then
       result := CreateFileW(fileName, c1, c2, nil, c3, 0, 0)
  else result := CreateFileA(pchar(string(wideString(fileName))), c1, c2, nil, c3, 0, 0);
end;

컴파일러 에러는  else result := CreateFileA(pchar(string(wideString(fileName))), c1, c2, nil, c3, 0, 0);
이 부분에서
[DCC Error] aModyUnit.pas(617): E2010 Incompatible types: 'Char' and 'AnsiChar'
이게 발생합니다. 코드기어 문서나 유니코드 관련 문서 봐도 이해 안되기는 매 한가지구요 ㅠ.ㅠ

procedure _FillStr(var str: string; fillLen: integer; addLeft: boolean; fillChar: char);
var s1 : string;
begin
  if fillLen > 0 then begin
    SetLength(s1, fillLen);
    system.FillChar(pointer(s1)^, fillLen, byte(fillChar));
    if addLeft then begin
      if (fillChar in ['0'..'9']) and (str <> '') and (str[1] = '-') then
           str := '-' + s1 + RetDelete(str, 1, 1)
      else str := s1 + str;
    end else str := str + s1;
  end;
end;

경고는  if (fillChar in ['0'..'9']) and (str <> '') and (str[1] = '-') then
이 부분에서
[DCC Warning] aModyUnit.pas(278): W1050 WideChar reduced to byte char in set expressions.  Consider using 'CharInSet' function in 'SysUtils' unit.

그래서  [DCC Fatal Error] aFile.pas(8): F2063 Could not compile used unit 'aModyUnit.pas'
나와서 컴파일이 안되는데 저 문제가 해결되면 또 다른 에러가 발생하겠지만 돌파구를 알려주십시오.

스킨콤포넌트까지 사용하는데 스킨 콤포넌트는 2010에서 컴파일이 안되고
MFC에서도 VS2008에서 와이드케릭터로 사람 머리아프게 만들더니 델파이도 같은 증상이 나와서 좌절입니다.
세상의 모든 프로그램이 기본적으로 유니코드를 지원하는날이 오길 바랍니다.

여러분 새해복많이 받으세요~

+ -

관련 글 리스트
13129 유니코드 관련 에러 도와 주세요 미모아 1902 2010/02/16
13130     Re:유니코드 관련 에러 도와 주세요 미노 3365 2010/02/16
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.