delphi

Running an external php script from Delphi

Ok - this is in continuation from my earlier question about sending an email using a php script. I'm now using PEAR to send the mail. The php script i use is the following one (successfull if executed alone): PHPEMail.php <?php require_once "Mail.php"; // Pear Mail.php $from = "FromName <[email protected]>"; $to = $_POST["dest...

How to detect if file in IDE is being edited using Open Tools API

I made a small IDE plug-in using Open Tools API that accesses ClearCase. It has menu items "Check In", "Check Out", etc. It works OK but I want it to check out a read-only file automatically if I start typing in IDE editor or if I attempt to save the file. Do you think this is possible? I tried a few things but gave up eventually. IOTAE...

Lock free multiple readers single writer

I have got an in memory data structure that is read by multiple threads and written by only one thread. Currently I am using a critical section to make this access threadsafe. Unfortunately this has the effect of blocking readers even though only another reader is accessing it. There are two options to remedy this: use TMultiReadExclu...

How do I add custom properties to a form

I am trying to add a custom property to a base form that can be accessed via the Delphi property editor. If I simply add the property as I would with a standard component the property won't show up in the property editor. Here's what I tried: unit TestForm; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Con...

How to create an application that listens to windows events?

How do i write a windows application that listens to particular keys strokes to launch it! just the way google desktop app works,press ctrl twice and it pop up! I would prefer examples in delphi, but i dont mind other languages to! For starters i assume it should be a service running in windows (i can be able to create a service applic...

ExitProcess from the OnShow event of MainForm in Delphi

I have an application that on startup checks some conditions and launches an external program in the OnShow event of the Main Form. The problem is that if there is an error when launching the external program, I want the application to terminate immediately. But there is an issue with that, in that EurekaLog catches my exceptions and som...

How to make a progress bar in Turbo Delphi using ONLY TLabel NOT TProgressBar

so here the logic for 1%="|" in the TLabel and for one "|" we need 10 times looping so to reach 100%= 100 times "|" we need 1000 times looping can you help me with the code? ...

How to copy a RTF string to the clipboard in delphi 2009?

Here is my code that was working in Delphi pre 2009? It just either ends up throwing up a heap error on SetAsHandle. If I change it to use AnsiString as per original, i.e. procedure RTFtoClipboard(txt: string; rtf: AnsiString); and Data := GlobalAlloc(GHND or GMEM_SHARE, Length(rtf)*SizeOf(AnsiChar) + 1); then there is no error but...

How can I run the Delphi XML schema binding generator from the command line?

For build automation, I would like to invoke the XML Data Binding Wizard in Delphi from a build script. I have found the WSDLImp.exe, but this tool seems to generate WSDL based Delphi code only. Is the XML schema binding wizard (which generates Delphi code for XSD files) available as a command line tool? ...

Delphi "DOMVendor" Open XML and Xerces: known limitations?

Is it safe to use Open XML instead of MSXML as the DOM Vendor with Delphi's IXMLDocument interface? Are there known limitations in basic functionality which I should be aware of? And how do the Open XML and Xerces implementations differ? (Xerces needs additional libraries, while Open XML seems to be included in the executable iirc) ...

Is it safe to use Free instead of Release for modal forms in Delphi?

The Delphi online help says that Release should be used to remove a form from memory. However, in many examples for modal forms I have seen this construct: MyForm := TMyForm.Create(nil); try MyForm.ShowModal; finally MyForm.Free; end; Is Free a safe way to destroy a modal form? As I can see in the source for ShowModal, Application...

How to generate Pascal code from an XML schema in Delphi Prism?

I need to import some XML schemas. In Delphi, I would use the the XML Data Binding Wizard to generate the Pascal code from the schemas. Is there something like that in Delphi Prism to avoid writing all this boilerplate code? ...

Is sqrt still slow in Delphi 2009?

Is sqrt still slow in Delphi 2009? Are the old tricks (lookup table, approx functions) still useful? ...

Delphi - TWebBrowser issues

Two quick questions How do I set focus to a TWebBrowser? This is so the mouse wheel scrolls the display without having to click within the TWebBrwoser display area first. It has a setfocus method that does nothing (or seems to do nothing). Within a TWebBrowser, right click a displayed link and select properties. The OK and Cancel bu...

How to make a splash screen with a progress bar on Turbo Delphi?

(Unit1.pas) unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls,unit2; type TForm1 = class(TForm) Button1: TButton; Label1: TLabel; Timer1: TTimer; procedure Timer1Timer(Sender: TObject); ...

Embedding Mono in Delphi Win32

Does anyone know the specifics of how to embed the Mono runtime in a Delphi Win32 application? The official documentations is not very helpful with regards to the Win32 environment (www.mono-project.com/Embedding_Mono). Upate: I am very familiar with the vagaries of static linking in Delphi and would be perfectly happy with a DLL. Mono...

How to print stickers easily (in colors)

Hello, I need to develop a small delphi app that prints stickers (text + graphics) to label printer such as DYMO one by one. What is best way to do this, is there e.g. some custom API for DYMO printers or how to print color graphics to small stickers? ...

Is accessing to different indexes of a TObjectList thread safe?

I have a TObjectList that needs to be processed by several threads. Since internally TObjectList inherits from TList and TList implements its internals as an array I wonder: Is it thread safe to access the array from different threads as long as we access different indexes? For example, having a TObjectList called myObjectList: start ...

Delphi: How to organize source code to increase compiler performance?

I'm working on a large delphi 6 project with quite a lot of dependancies. It takes several minutes to compile the whole project. The recompilation after a few changes is sometimes much more longer so that it is quicker to terminate Delphi, erase all dcu files and recompile everything. Does anyone know a way to identify, what makes the c...

Font smoothing in Delphi

I had cause to need a label with a large font on a Delphi form and noticed that its curves were still slightly jagged. I compared this with the same size and font in MSWord which was much smoother. After research I found code that allowed me to smooth my fonts but it's messy and I was wondering if there was a better way? Looking in t...