Delphi

How can I troubleshoot design-time packages in Delphi/C++Builder?

為{幸葍}努か 提交于 2021-02-07 20:56:15
问题 I have consistently had IDE problems in Delphi/C++Builder for years, with every version. I usually just reboot, recompile, etc. and move on. However, I keep seeing others say that the IDE is rock solid. I've read many people say that most IDE problems are a result of custom component problems. We have several of our own custom components and I would not be at all surprised that they were causing the problems. However, I have no idea how to find out. 1) I cannot easily just uninstall a

delphi variable value is changing at thread in a loop

痴心易碎 提交于 2021-02-07 20:43:39
问题 my code is running a for loop to process some data like here procedure printValue(Value: Integer); begin TThread.Synchronize(TThread.Current, procedure begin form1.memo1.lines.add( Value.ToString ); end); end; procedure TForm1.Button1Click(Sender: TObject); var I: Integer; myThread : TThread; Proc1: TMyProc; begin for I := 0 to 10 do begin myThread := TThread.CreateAnonymousThread( procedure begin printValue( i ); end); myThread.Start; end; end; this code out put is like this: 3 5 6 8 9 11 10

delphi variable value is changing at thread in a loop

半世苍凉 提交于 2021-02-07 20:43:27
问题 my code is running a for loop to process some data like here procedure printValue(Value: Integer); begin TThread.Synchronize(TThread.Current, procedure begin form1.memo1.lines.add( Value.ToString ); end); end; procedure TForm1.Button1Click(Sender: TObject); var I: Integer; myThread : TThread; Proc1: TMyProc; begin for I := 0 to 10 do begin myThread := TThread.CreateAnonymousThread( procedure begin printValue( i ); end); myThread.Start; end; end; this code out put is like this: 3 5 6 8 9 11 10

Delphi : Sorted List

社会主义新天地 提交于 2021-02-07 20:30:41
问题 I need to sort close to a 1,00,000 floating point entries in Delphi. I am new to Delphi and would like to know if there are any ready made solutions available. I tried a few language provided constructs and they take an inordinate amount of time to run to completion.(a 5-10 sec execution time is fine for the application) 回答1: why not just implement a quick Sort algorithm? see this simple code program ProjectSortFoat; {$APPTYPE CONSOLE} uses SysUtils; procedure QuickSort(var List: array of

Delphi - Get Windows' default non-unicode character set

瘦欲@ 提交于 2021-02-07 20:11:04
问题 I have a Delphi 7 application. I need to be able to get the default Windows character set for non-unicode programs. I know DEFAULT_CHARSET sets it, but I need to know exactly which charset it is, so that I could compare it to other character sets. Is this possible and how? Thanks! 回答1: GetFontData is calling GetObject and using LogFont.lfCharSet to determine the charset GetObject called with HFONT will fill LogFont Definition here is DEFAULT_CHARSET is set to a value based on the current

Delphi 6 Compiler Options (Pentium-safe FDIV)

元气小坏坏 提交于 2021-02-07 19:56:38
问题 I recieved a crash report from MadExcept from a user. The Exception was Invalid floating point operation. The odd part though is that the callstack dies at @FSafeDivide. I did a google and found out that this was a check for certain pentium chips which didn't do division correctly. If the test failed all the divisions would be done in software rather than hardware. I have the Pentium-Safe FDIV option turned on in my compiler settings. Could this have caused the error? I also read somewhere

How to reliably detect RICHTEXT format on clipboard?

流过昼夜 提交于 2021-02-07 17:22:55
问题 Embarcadero RAD Studio VCL has the TClipboard.HasFormat Method, with a usage e.g. Clipboard.HasFormat(CF_TEXT) or Clipboard.HasFormat(CF_BITMAP) etc.. But I did not find any supported CF_RTF or CF_RICHTEXT format-descriptor which indicates a rich-text format in the clipboard. So I created some formatted text in Microsoft WordPad and copied it to the clipboard. Then I used a clipboard-spy program to inspect the formats on the clipboard: This lists 3 RichText formats with the format-descriptors

ShellExecute failing if spaces in Path

别来无恙 提交于 2021-02-07 14:56:55
问题 I have a Delphi application that uses ShellExecute to call a second Delphi Application on a button press. The applications are stored on the same server, on the same network share. Their paths are in the format: const JobManager = 'Z:\Apps\Application 1\Application1.exe'; FeeManager = 'Z:\Apps\Application 2\Application2.exe'; The call to ShellExecute is made as follows: rh := FindWindow(PChar('TMF'), PChar('Edit Job Details')); if rh = 0 then begin ShellExecute(Handle, 'open', JobManager, nil

Opening TWebBrowser link in default browser

给你一囗甜甜゛ 提交于 2021-02-07 14:33:22
问题 My application displays a small banner loaded from the web in a TWebBrowser control. This banner is actually a HTML page including an image; when the users click the image it takes them to the promotional campaign we're currently running. The bad thing here is that when clicking the link in TWebBrowser, the campaign page is opened in Internet Explorer, not in their default browser. I know this happens because TWebBrowser is a IE-based control, but is there a way to open the link in users'

Async InputQuery doesn't handle Cancel button

孤街醉人 提交于 2021-02-07 14:31:21
问题 I'm using a simple call to TDialogServiceAsync.InputQuery() with a single input. It just ignores both the Cancel button and the window's X close button. But the Ok button works fine. This is my code: uses FMX.DialogService.Async; procedure TForm1.Button1Click(Sender: TObject); begin TDialogServiceAsync.InputQuery('Title', ['Insert value'], ['bla bla'], procedure(const AResult: TModalResult; const AValues: array of string) begin if Aresult = mrOk then ShowMessage('Ok!'); if Aresult = mrCancel