delphi-xe7

Why this thread raise exception? [duplicate]

久未见 提交于 2019-12-01 13:10:57
问题 This question already has answers here : Delphi: Access Violation at the end of Create() constructor (2 answers) Closed 3 years ago . i am trying to create a thread in sample project but i got an exception raised here is the sample project code unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender:

Indy error 10038 “Socket operation on non-socket” after 61 seconds of inactivity

给你一囗甜甜゛ 提交于 2019-12-01 12:30:30
I want to download some large files (GB) from an FTP server. The download of the first file always works. Then when trying to get the second file I get: "Socket Error # 10038. Socket operation on non-socket." The error is on 'Get'. After 'Get' I see these messages (via FTP status event): Starting FTP transfer Disconnecting. Disconnected. The code is like this: {pseudo-code} for 1 to AllFiles do begin if Connect2FTP then begin FTP.Get(Name, GzFile, TRUE, FALSE); <--- Socket operation on non-socket" error (I also get EIdConnClosedGracefully 'Connection Closed Gracefully' in IDE, F9 will resume

Indy error 10038 “Socket operation on non-socket” after 61 seconds of inactivity

女生的网名这么多〃 提交于 2019-12-01 12:29:34
问题 I want to download some large files (GB) from an FTP server. The download of the first file always works. Then when trying to get the second file I get: "Socket Error # 10038. Socket operation on non-socket." The error is on 'Get'. After 'Get' I see these messages (via FTP status event): Starting FTP transfer Disconnecting. Disconnected. The code is like this: {pseudo-code} for 1 to AllFiles do begin if Connect2FTP then begin FTP.Get(Name, GzFile, TRUE, FALSE); <--- Socket operation on non

Program freezes but the CPU utilization is zero

三世轮回 提交于 2019-12-01 02:38:37
Sometimes my program freezes. If i click 'Pause program' it shows me this: ntdll.RtlUserThreadStart: 773301C4 89442404 mov [esp+$04],eax 773301C8 895C2408 mov [esp+$08],ebx 773301CC E9E9960200 jmp $773598ba 773301D1 8DA42400000000 lea esp,[esp+$0000] 773301D8 8DA42400000000 lea esp,[esp+$0000] 773301DF 90 nop 'Call Stack' window IS EMPTY! Pressing F8 three times, the program jumps to ntdll.RtlInitializeExceptionChain: 7735989F 8BFF mov edi,edi I cannot reproduce it on demand but I see the problem once per day (maybe less?). The compiler/debugger is running in 32 bit. Any idea if this is a

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

倾然丶 夕夏残阳落幕 提交于 2019-12-01 02:00:39
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) //overwrite else IOUtils.TFile.AppendAllText(FileName, uString); //append end; Simple right? What could go

Program freezes but the CPU utilization is zero

試著忘記壹切 提交于 2019-11-30 21:21:17
问题 Sometimes my program freezes. If i click 'Pause program' it shows me this: ntdll.RtlUserThreadStart: 773301C4 89442404 mov [esp+$04],eax 773301C8 895C2408 mov [esp+$08],ebx 773301CC E9E9960200 jmp $773598ba 773301D1 8DA42400000000 lea esp,[esp+$0000] 773301D8 8DA42400000000 lea esp,[esp+$0000] 773301DF 90 nop 'Call Stack' window IS EMPTY! Pressing F8 three times, the program jumps to ntdll.RtlInitializeExceptionChain: 7735989F 8BFF mov edi,edi I cannot reproduce it on demand but I see the

Why are all the dialogs are using the “old” Android 2.x style?

笑着哭i 提交于 2019-11-30 15:44:49
I am currently using RAD Studio XE7 and just wondering why all the dialogs in my Android app are using the "old" 2.x style? And how to force my Android app to use the 4.x style in all the dialogs like date picker and MessageDlg? Using StyleBook and modying the AndroidManifest.xml didn't work. Thanks in advance. David I posted the answer to your same question on the Embarcadero Community Answers site: Why all the dialogs are using the "old" Android 2.x style? I alerted our development team and they found the problem in an Android helper function. Here is the reply from R&D with the workaround:

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

白昼怎懂夜的黑 提交于 2019-11-30 14:18:36
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? 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 dwOption: DWORD; Value: record case Integer of 1: (dwValue: DWORD); 2: (pszValue: {$IFDEF DELPHI2009_UP

SearchBuf soWholeWord unexpected output

爷,独闯天下 提交于 2019-11-30 13:30:36
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'); // True Test('Delphi ','Delphi'); // True Test(' Delphi','Delphi'); // False Test(' Delphi ','Delphi'); //

How to 'parent' a form? (Controls won't accept focus)

大憨熊 提交于 2019-11-30 09:23:58
问题 I have a child form 'frmTest' and a main form 'TfrmMain'. I set the main form as parent for frmTest like this: unit Main; INTERFACE USES System.SysUtils, System.Classes, Vcl.Forms, Test, Vcl.StdCtrls, Vcl.Controls; type TfrmMain = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private public end; IMPLEMENTATION {$R *.dfm} procedure TfrmMain.Button1Click(Sender: TObject); VAR frmTest: TChildForm; begin Application.CreateForm(TChildForm, frmTest); //frmTest:= TForm1