delphi

Step by step upgrade of Indy 10 in Delphi 2009

Can someone help in telling the details on how to uninstall Indy 10 and install the latest build? I found it http://indy.fulgan.com/ZIP/IndyTiburon.zip There is a similar question, but not a satisfying answer, just some comments from the user who asked, but that is not a step by step guide. Why there is not a tool for this? ...

Reading a text file with fixed length fields and records in Delphi

I need to read data from a text file where the field lengths and record lengths are fixed. Fields are either zero padded or space padded, always appear in the same order and each record is terminated by a CRLF. The file can have one of three possible record types determined by the first character in the record. So far I've create a base...

FlushFileBuffers as good as CloseHandle then CreateFile at saving data to disk?

For a file on disk, is the Win32 function FlushFileBuffers as reliable and certain as closing the file using CloseHandle then re-opening the file using CreateFile? Are there circumstances where CloseHandle then CreateFile are better because they save the data correctly to disk when FlushFileBuffers does not? ...

Delphi: How to copy forms

I'm trying to copy, or 'exchange' two forms that are referenced by a TListBox. Here's what I'm trying to do, but I get an error (shown below): cf1 := TCustomform(lstPackages.Items.Objects[origNdx]); cf2 := TCustomform(lstPackages.Items.Objects[origNdx - 1]); cfTmp.Assign(cf1); //error here: cannot assign TfPackage to...

Delphi TOpenDialog hangs in windows 2008 when run as remote desktop application

I have a Delphi 2010 exe that launches a second exe. In the second exe, there is a dialog that calls openDialog.execute. When this runs under Windows 2008 Enterprise R2 under a remote desktop, it runs as expected, but when run as a remote application, as soon as the file dialog pops up, the application hangs, turning all of the applica...

Delphi 7 compared to 2009 (& 2010) Record sizes

Hi There... I have a weird issue when converting code from Delphi 7 to 2010. It has to do with records. The record defined below, when sized in D7, is 432 bytes, and in D2009 (and 2010) it's 496. I know, that an easy solution is to make it a packed record, then all versions come out to 426 bytes... However, we have data stored where ...

Code Syntax Highlighting in Delphi 6 (to highlight syntax and ifdef blocks)

Delphi 6 is pretty old, I know. Unfortunately there are reasons why I can't upgrade which I don't want to get into here. My problem is that it's hard to read code. I have the Castalia plugin which helps a bit (parenthesis matching, shows blocks of if, else, end) but it doesn't highlight the syntax like other IDEs do (variables, cons...

Delphi memo box won't capture Return key

Hi everyone hope you're all well. I have a question about memo box behaviour in Delphi, I have an application with two forms, both are dialogs and they both have memo boxes in them and they both have an OK button on them, however one dialog behaves differently from the other - if I am in the memo area and i type something and then press ...

Delphi - What happens with un-freed (but terminated) thread when application exits?

Hello, I have multithreaded application and I've got a little problem when application ends: I can correctly terminate the thread by calling TThread.Terminate method in Form1.OnDestroy event handler, but the termination does take some time and so I can't free the memory (by TThread.Free method). Unfortunately for some other reason I mus...

Where can I find a "Turbo" or "Lite" version of Delphi?

I have a co-worker with a strong background in Ruby that is interested in getting started with Delphi and native development. However, I understand that Turbo Delphi (based on Delphi 2006) is no longer available for download. So...where does that leave him? Is there any low cost or introductory version of Delphi available legally somewh...

EXE from Delphi 2006 : Buttons/Checkbox/Radios not visible until mouse is hovered (on Vista/Win7)

Under Windows Vista and Win7 there is a problem with applications created by Delphi (we use Delphi 2006, but it seems other versions have the same problem) which contain the XP manifest. All descendants of TButtonControl (TButton, TCheckBox, TRadioButton, but not TBitBtn) are not visible after a form is initially shown. The controls app...

Is it good to use the latest version of OpenSSL with Indy or not?

I just upgraded Indy to th latest version (10.5.7), I was using the OpenSSL dlls in version 0.9.8.13. Is it good to use the latest version (1.0.0a) or since the version I have (0.9.8.13) works fine it is a risk to upgrade since there can be bugs in it? ...

Suggestions for deploying openSSL dlls

I made a simple application that uses Indy and requires OpenSSL dlls. I am not going to write an installer for it, so I have 2 options: 1) deploy it by copying the application exe + libeay32.dll + ssleay32.dll in the same folder 2) put libeay32.dll and ssleay32.dll in the exe resources and extract them to the applicationpath on progra...

Delphi: Can I start short apps from a service?

Hi! I created a scheduler. It was threaded first, but because of memory leaks and separatable tasks I changed to subprocesses. The service starts the subprocesses by N minutes or in determined time. I finished with all thing, but I'm not sure now that service can start an application or not? I want to use this as processfarm - as Post...

c# Type Alias/Custom Type

Im trying to convert some Delphi code to c# and I've come across a problem... In Delphi I've decalared a new type Type TData = Array of Extended where I can access the result of functions returning this type with statements like Function TMyObject.ReadData:TData; begin ... end; Data := MyObject.ReadData; Result = Data[7] + Data[12]...

Delphi: best way to convert rtf to text

I need to convert rtf to plain text. i used to write a function that strips away rtf headers but it is never perfect. So one option can be using a TRichEdit created at runtime (something like described here but done of course at runtime). But is there another way? Is there an rtl function for this or a better approach? UPDATE: In this...

Delphi : Prevent TPageControl Hint from showing on contained items.

I have a form with the following components: A TPageControl containing a single TTabSheet, containing a TEdit. I want a hint "Hello" displayed when I mouse over the pagecontrol tab, and no hint displayed when I mouse over the TEdit. The PageControl has a hint= "Hello", and showhint = true. This works as expected. The TEdit has showhin...

How to send arrow keys to Adobe Flash Player inside a Delphi TWebBrowser control?

I am using a TWebBrowser control inside a Delphi Pro 6 form (TForm) to view a YouTube video on YouTube's "leanback" interface page. I want to send arrow keys to the Flash Player that is playing the video but I can't seem to get it to work. I've tried using SendKeys but my guess is that I am unable to get the keystroke events to the Fla...

paste with delphi in ole automation

i want paste in delphi from richedit to word application i used Following code but Twice paste data in word (duplicate) WordApp := GetActiveOleObject('Word.Application'); WordApp.Visible := True; Wordapp.documents.open('C:\Doc1.docx'); Richedit.Text := 'test text'; Richedit.SelectAll; Richedit.CopyToClipboard; WordApp.Acti...

Delphi {$IFDEF CONSOLE} Problem

I just tried program Project1; {$APPTYPE CONSOLE} uses SysUtils; begin {$IFDEF CONSOLE} beep; {$ENDIF} end. and expected to hear a beep during runtime, but not. The following test works, though: if IsConsole then beep; Why doesn't the compile-time test work? As far as I can understand from this doc, it sure shoul...