diff --git a/Packages/DXE2/X2Utils.dpk b/Packages/DXE2/X2Utils.dpk index 59674f0..59cde7b 100644 --- a/Packages/DXE2/X2Utils.dpk +++ b/Packages/DXE2/X2Utils.dpk @@ -58,6 +58,6 @@ contains X2UtElevation in '..\..\X2UtElevation.pas', X2UtPersistXML in '..\..\X2UtPersistXML.pas', X2UtPersistXMLBinding in '..\..\X2UtPersistXMLBinding.pas', - XMLDataBindingUtils in '..\..\XMLDataBinding\XMLDataBindingUtils.pas'; + XMLDataBindingUtils in '..\..\XMLDataBindingUtils.pas'; end. diff --git a/Packages/DXE2/X2Utils.dproj b/Packages/DXE2/X2Utils.dproj index 11cd811..cb2d0f5 100644 --- a/Packages/DXE2/X2Utils.dproj +++ b/Packages/DXE2/X2Utils.dproj @@ -61,7 +61,7 @@ X2Utils_Icon.ico - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) true 1033 CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= @@ -172,7 +172,7 @@ - + Cfg_2 Base diff --git a/Packages/DXE2/X2Utils.res b/Packages/DXE2/X2Utils.res index 8cbdc5a..e43db43 100644 Binary files a/Packages/DXE2/X2Utils.res and b/Packages/DXE2/X2Utils.res differ diff --git a/X2UtCompilerVersion.inc b/X2UtCompilerVersion.inc index fd34306..68bbac4 100644 --- a/X2UtCompilerVersion.inc +++ b/X2UtCompilerVersion.inc @@ -122,6 +122,11 @@ // so I don't know what defines they have... if you do know, // feel free to send me any changes... {$IFDEF DUNKNOWN} + {$DEFINE DXE2PLUS} + {$DEFINE DXEPLUS} + {$DEFINE D2010PLUS} + {$DEFINE D2009PLUS} + {$DEFINE D2007PLUS} {$DEFINE D2006PLUS} {$DEFINE D2005PLUS} {$DEFINE D8PLUS} @@ -133,3 +138,4 @@ {$DEFINE D2PLUS} {$DEFINE D1PLUS} {$ENDIF} + diff --git a/X2UtNamedFormat.pas b/X2UtNamedFormat.pas index 3743edb..6fde1c8 100644 --- a/X2UtNamedFormat.pas +++ b/X2UtNamedFormat.pas @@ -176,9 +176,9 @@ begin param := AParams[paramIndex]; case param.VType of - vtChar: name := param.VChar; - vtString: name := param.VString^; - vtPChar: name := param.VPChar; + vtChar: name := string(param.VChar); + vtString: name := string(param.VString^); + vtPChar: name := string(param.VPChar); vtAnsiString: name := PChar(param.VAnsiString); else raise Exception.CreateFmt('Parameter name at index %d is not a string value', diff --git a/X2UtOS.pas b/X2UtOS.pas index ecc8def..174e837 100644 --- a/X2UtOS.pas +++ b/X2UtOS.pas @@ -278,7 +278,7 @@ begin end; if StrLen(versionInfo.szCSDVersion) > 0 then - VersionString := VersionString + ' ' + versionInfo.szCSDVersion; + VersionString := VersionString + ' ' + string(versionInfo.szCSDVersion); case versionInfo.dwPlatformId of VER_PLATFORM_WIN32_NT: diff --git a/X2UtPersist.pas b/X2UtPersist.pas index d34b8fb..0bf4864 100644 --- a/X2UtPersist.pas +++ b/X2UtPersist.pas @@ -112,6 +112,9 @@ uses X2UtStrings; +{$I X2UtCompilerVersion.inc} + + type { This class has to proxy all the interfaces in order for reference counting to go through this class. } @@ -348,15 +351,15 @@ begin tkInteger, tkChar, tkWChar: - if ReadInteger(APropInfo^.Name, ordValue) then + if ReadInteger(string(APropInfo^.Name), ordValue) then SetOrdProp(AObject, APropInfo, ordValue); tkFloat: - if ReadFloat(APropInfo^.Name, floatValue) then + if ReadFloat(string(APropInfo^.Name), floatValue) then SetFloatProp(AObject, APropInfo, floatValue); tkEnumeration: - if ReadString(APropInfo^.Name, stringValue) then + if ReadString(string(APropInfo^.Name), stringValue) then begin ordValue := GetEnumValue(APropInfo^.PropType^, stringValue); if ordValue >= 0 then @@ -364,14 +367,16 @@ begin end; tkString, + {$IFDEF D2009PLUS} + tkUString, + {$ENDIF} tkLString, - tkWString, - tkUString: - if ReadString(APropInfo^.Name, stringValue) then + tkWString: + if ReadString(string(APropInfo^.Name), stringValue) then SetStrProp(AObject, APropInfo, stringValue); tkSet: - if ReadString(APropInfo^.Name, stringValue) then + if ReadString(string(APropInfo^.Name), stringValue) then begin try ordValue := StringToSet(APropInfo, stringValue); @@ -382,11 +387,11 @@ begin end; tkVariant: - if ReadVariant(APropInfo^.Name, variantValue) then + if ReadVariant(string(APropInfo^.Name), variantValue) then SetVariantProp(AObject, APropInfo, variantValue); tkInt64: - if ReadInt64(APropInfo^.Name, int64Value) then + if ReadInt64(string(APropInfo^.Name), int64Value) then SetInt64Prop(AObject, APropInfo, int64Value); tkClass: @@ -396,11 +401,11 @@ begin begin if objectProp is TStream then begin - ReadStream(APropInfo^.Name, TStream(objectProp)); + ReadStream(string(APropInfo^.Name), TStream(objectProp)); end else begin { Recurse into object properties } - if BeginSection(APropInfo^.Name) then + if BeginSection(string(APropInfo^.Name)) then try AContinue := Read(objectProp); finally @@ -457,35 +462,38 @@ begin tkWChar: begin ordValue := GetOrdProp(AObject, APropInfo); - WriteInteger(APropInfo^.Name, ordValue); + WriteInteger(string(APropInfo^.Name), ordValue); end; tkFloat: begin floatValue := GetFloatProp(AObject, APropInfo); - WriteFloat(APropInfo^.Name, floatValue); + WriteFloat(string(APropInfo^.Name), floatValue); end; tkEnumeration: begin ordValue := GetOrdProp(AObject, APropInfo); stringValue := GetEnumName(APropInfo^.PropType^, ordValue); - WriteString(APropInfo^.Name, stringValue); + WriteString(string(APropInfo^.Name), stringValue); end; tkString, + {$IFDEF D2009PLUS} + tkUString, + {$ENDIF} tkLString, tkWString: begin stringValue := GetStrProp(AObject, APropInfo); - WriteString(APropInfo^.Name, stringValue); + WriteString(string(APropInfo^.Name), stringValue); end; tkSet: begin ordValue := GetOrdProp(AObject, APropInfo); stringValue := SetToString(APropInfo, ordValue, True); - WriteString(APropInfo^.Name, stringValue); + WriteString(string(APropInfo^.Name), stringValue); end; tkVariant: @@ -496,7 +504,7 @@ begin tkInt64: begin int64Value := GetInt64Prop(AObject, APropInfo); - WriteInt64(APropInfo^.Name, int64Value); + WriteInt64(string(APropInfo^.Name), int64Value); end; tkClass: @@ -506,11 +514,11 @@ begin begin if objectProp is TStream then begin - WriteStream(APropInfo^.Name, TStream(objectProp)); + WriteStream(string(APropInfo^.Name), TStream(objectProp)); end else begin { Recurse into object properties } - if BeginSection(APropInfo^.Name) then + if BeginSection(string(APropInfo^.Name)) then try Write(objectProp); finally diff --git a/X2UtTempFile.pas b/X2UtTempFile.pas index 15d975a..43ba767 100644 --- a/X2UtTempFile.pas +++ b/X2UtTempFile.pas @@ -25,6 +25,8 @@ uses Windows; +{$I X2UtCompilerVersion.inc} + function GetAppDataPath(): String; var @@ -122,7 +124,11 @@ end; function IsValidFileChar(const AChar: Char): Boolean; begin + {$IFDEF DXE2PLUS} + Result := not CharInSet(AChar, ['\', '/', ':', '*', '?', '"', '<', '>', '|']); + {$ELSE} Result := not (AChar in ['\', '/', ':', '*', '?', '"', '<', '>', '|']); + {$ENDIF} end;