Delphi 2009 <> Delphi 2007 (any old version) is STRING type:
+ In Delphi2009 (12),
type STRING = UnicodeString
UnicodeString is not the same WideString
+ In Delphi 2007 (6,7,8,9,10,11)
STRING is the same AnsiString
WideString support for Unicode.
Because any different type in old version with Delphi 2009, someone must change anything in the PAS files of the old version:
+ In package, replace VclJpg with VclImg
+ Replace WideString with string
+ Replace WideChar with Char.
You look WideCharToMultibyte, MultibyteToWideChar may be error! Because "WideChar"-->"Char"
+ Replace WChar with Char
+ Replace AnsiStrComp with StrComp
Do that with any Ansi function.
+ Find some words as "Ansi" to remove it if you need.
When above replacements is done, you are successful!
+ In Delphi2009 (12),
type STRING = UnicodeString
UnicodeString is not the same WideString
+ In Delphi 2007 (6,7,8,9,10,11)
STRING is the same AnsiString
WideString support for Unicode.
Because any different type in old version with Delphi 2009, someone must change anything in the PAS files of the old version:
+ In package, replace VclJpg with VclImg
+ Replace WideString with string
+ Replace WideChar with Char.
You look WideCharToMultibyte, MultibyteToWideChar may be error! Because "WideChar"-->"Char"
+ Replace WChar with Char
+ Replace AnsiStrComp with StrComp
Do that with any Ansi function.
+ Find some words as "Ansi" to remove it if you need.
When above replacements is done, you are successful!

本文详细介绍了从Delphi2007迁移到Delphi2009所需的更改步骤,包括如何适配UnicodeString类型、替换组件及函数等,以确保旧版代码能在新版环境中正常运行。
475

被折叠的 条评论
为什么被折叠?



