delphi-xe7

Never-build package [xxx] must be recompiled / SHARING VIOLATION [Delphi documentation issue]

£可爱£侵袭症+ 提交于 2019-12-22 08:34:46
问题 I just upgraded to Delphi XE7. Now a package that complied perfectly in XE doesn't compile anymore. I have package B that requires package A that has ImplicitBuild set to OFF. First thing first, I compiled and installed package A. Then I tried to compile package B but the compiler says: [dcc32 Fatal Error] A.dpk(39): E2225 Never-build package 'A' must be recompiled. [dcc32 Fatal Error] B.dpk(34): E2202 Required package 'A' not found. Obviously, package A was found since the compiler knows its

How to save classic Delphi string to disk (and read them back)?

最后都变了- 提交于 2019-12-19 05:10:13
问题 I want to achieve a very very basic task in Delphi: to save a string to disk and load it back. It seems trivial but I had problems doing this TWICE since I upgraded to IOUtils (and one more time before that... this is why I took the 'brilliant' decision to upgrade to IOUtils). I use something like this: procedure WriteToFile(CONST FileName: string; CONST uString: string; CONST WriteOp: WriteOperation); begin if WriteOp= (woOverwrite) then IOUtils.TFile.WriteAllText (FileName, uString) /

How to save classic Delphi string to disk (and read them back)?

放肆的年华 提交于 2019-12-19 05:10:09
问题 I want to achieve a very very basic task in Delphi: to save a string to disk and load it back. It seems trivial but I had problems doing this TWICE since I upgraded to IOUtils (and one more time before that... this is why I took the 'brilliant' decision to upgrade to IOUtils). I use something like this: procedure WriteToFile(CONST FileName: string; CONST uString: string; CONST WriteOp: WriteOperation); begin if WriteOp= (woOverwrite) then IOUtils.TFile.WriteAllText (FileName, uString) /

How do I set each TWebBrowser to use an independent proxy?

老子叫甜甜 提交于 2019-12-18 16:50:40
问题 I have found all kind of examples about how to make TWebBrowser use a proxy (like 202.8.128.5:8080). However all those examples are changing the proxy globally for all running instances of TWebBrowser. I have two instances. How do I set a different proxy for each browser? 回答1: This can be achieved using the following code (public code, not mine): {$DEFINE DELPHI2009_UP} function SetProxy(Server: String): Boolean; // Server z.B. '127.0.0.1:8080' oder '' type INTERNET_PER_CONN_OPTION = record

SearchBuf soWholeWord unexpected output

余生颓废 提交于 2019-12-18 15:52:33
问题 When testing StrUtils.SearchBuf with [soWholeWord,soDown] option, some unexpected results occurred. program Project1; Uses SysUtils,StrUtils; function WordFound(aString,searchString: String): Boolean; begin Result := SearchBuf(PChar(aString),Length(aString), 0, 0, searchString, [soWholeWord,soDown]) <> nil; end; Procedure Test(aString,searchString: String); begin WriteLn('"',searchString,'" in "',aString,'"',#9,' : ', WordFound(aString,searchString)); end; begin Test('Delphi','Delphi'); //

Why are the Delphi zlib and zip libraries so slow under 64 bit?

亡梦爱人 提交于 2019-12-18 14:17:21
问题 Whilst benchmarking a real-world application I came across a surprising performance characteristic relating to the zlib and zip libraries that ship with Delphi. My real-world application exports .xlsx files. This file format is a collection of XML files wrapped in a ZIP container file. The .xlsx export code generates the XML files and then feeds them to the Delphi ZIP library. Once I had optimised the XML file generation to the point where the ZIP creation was the bottleneck I discovered, to

Create a customized Item Appearance for ListView Delphi XE7

僤鯓⒐⒋嵵緔 提交于 2019-12-17 12:38:22
问题 Im having a lot of trouble trying to create a customized item appearance for the TListView firemonkey control for Delphi XE7. What I want is to define my own "design" for what an item should be and use that item. For example : I would like to have an item with a Title(on top) - A Description(Middle) - A Date (Bottom) - Button(Right). I could not find any good documentation about this but i got some samples of how to create an TListView with muti details, but the problem is : that sample is

Create a customized Item Appearance for ListView Delphi XE7

烂漫一生 提交于 2019-12-17 12:38:12
问题 Im having a lot of trouble trying to create a customized item appearance for the TListView firemonkey control for Delphi XE7. What I want is to define my own "design" for what an item should be and use that item. For example : I would like to have an item with a Title(on top) - A Description(Middle) - A Date (Bottom) - Button(Right). I could not find any good documentation about this but i got some samples of how to create an TListView with muti details, but the problem is : that sample is

Is Writeln capable of supporting Unicode?

99封情书 提交于 2019-12-17 10:58:40
问题 Consider this program: {$APPTYPE CONSOLE} begin Writeln('АБВГДЕЖЅZЗИІКЛМНОПҀРСТȢѸФХѾЦЧШЩЪЫЬѢѤЮѦѪѨѬѠѺѮѰѲѴ'); end. The output on my console which uses the Consolas font is: ????????Z?????????????????????????????????????? The Windows console is quite capable of supporting Unicode as evidenced by this program: {$APPTYPE CONSOLE} uses Winapi.Windows; const Text = 'АБВГДЕЖЅZЗИІКЛМНОПҀРСТȢѸФХѾЦЧШЩЪЫЬѢѤЮѦѪѨѬѠѺѮѰѲѴ'; var NumWritten: DWORD; begin WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), PChar(Text

TJson.JsonToObject<T> throws errors in a multi-thread environment

强颜欢笑 提交于 2019-12-13 11:52:46
问题 When using TJson.JsonToObject in a multi-thread environment random access violations occur. I was searching a long time for the problem and I could isolate it with the following code JSON class type TParameter = class public FName : string; FDataType : string; FValue : string; end; Testfunction: procedure Test(); var myTasks: array of ITask; i : integer; max : integer; begin max := 50; SetLength(myTasks, max); for i := 0 to max -1 do begin myTasks[i] := TTask.Create(procedure () var json :