delphi

Collapsing If-Then-Else statements in code editor (Delphi 2007)

Every once in a while I'm editing some long pair of if-then-else statements (or worse, nested if-then-else statements) , like, say, this: if A < B then begin DoSomething; DoSomethingElse; {...and more statements going on and on and on...} FinallyWrapUpThisBit; end else begin DoThis; DoThat; {......

determine if another application is busy

How do I check if another application is busy? I have a program that sends text to a console. The text that I will send contains #13 char (i.e. ls#13cd documents#13dir). In other words I want to send many commands at one time and the console will process it one by one. I am sending it character by character. But sometimes it only execut...

Why is TADOBlobField.Savetofile only writing 8 Bytes.

I have a working application that I have revisited recently. I store a file in a text field in a MSSQL database. I read it into an ADOTable and as a TBlobfield call Savetofile to write it to a file on disk. This has always worked. However now it is simply saving a 8 byte file rather than the correct file. I have a vague memory of ...

How to implement a code coverage tool using Win32 Debugging API

I am trying to understand how to implement a Code Coverage tool using the Win32 Debugging API. My thinking has been to utilize the Win32 Debugging API to launch a process in debug mode - and track what CPU instructions has been executed. After having tracked all CPU instructions I would then use the map file to map it to what source cod...

How to send email through GMail using ICS?

How can I send email through gmail smtp account using ICS component? ...

Somehow COM object instance gets lost

I have a main app and a type library contains 2 COM objects, one is IFile, one is IFiles. IFiles creates IFile, and stores them in a TLIST, and has standard methods like Add, Remove etc. Both IFile and IFiles are TAutoObject. "Add" method in IFiles is working fine, it simply creates IFile object [Code 1], and adds it to TList. Problem i...

What is the Send API for accessing menu commands from outside application

hi, is there a send api to access a menu command in another application? For example,I am trying to access the View menu of a notepad. How am I going to do this? I already got the menu using GetSystemMenu but I can't access it. I think this has an API already but I don't know. ...

Delphi 2009 - Custom Enum type property in the Object Inspector

Hi, I have created a custom TAction type which has 2 additional properties which are of type string, and enumeration. The string value is showing in the object inspector fine, however, the enumeration type is not appearing at all. How can I get a custom enumeration type to display as a drop down property value in the object inspector? ...

The best reporting component for Delphi ?

We are a team that use Gnostice and RaveReports to view, print, mail and generate PDFs of reports using D2007. D2009 is in the roadmap but as Gnostice don't support D2009 we have to wait. In the past the reports was done in code and then viewed, printed etc. Now we have started to evaluate the Ravereports designer and make reports with t...

Delphi 2009: Search skipping diacritics in unicode utf-8

I am having utf-8 encoded file containing arabic text and I have to search it. My problem are diacritics, how to search skipping them? Like if you load that text in Internet Explorer (converting text in HTML ofcourse ), IE is skipping those diacritics? Any help? Edit1: Search is simply performed by following code: var m1 : TMemo; /...

How can I find all the units in my Delphi app?

It's easy enough to find all your external dependencies. Just run the program and open up the Modules info window. But how can I find all my internal dependencies? I know the program keeps a list of all the units, because I've traced my way through the initialization code a time or two. But is there any easy way to access this list f...

Converting TMemoryStream to String in Delphi 2009

We had the following code previous to Delphi 2009: function MemoryStreamToString(M: TMemoryStream): String; var NewCapacity: Longint; begin if (M.Size = 0) or (M.Memory = nil) then Result:= '' else begin if TMemoryStreamProtected(M).Capacity = M.Size then begin NewCapacity:= M.Size+1; TMemoryStreamProtec...

How Delphi 2009 converts Delphi 7 projects re build configurations

I'm moving frequently between D7 and D2009 with library code that works with both. For ease of going both ways, I'm routinely deleting all the D2009 additional files that get created, eg *.dproj etc such that on entry to D2009 I'm only ever taking D7 files. This is nice because D2009 automatically makes a *.dproj, *.dgroup etc and apart ...

Delphi 7 ADO connection pooling outside of IIS

We have a Delphi 7 application that runs as an ISAPI extension in IIS6. The code use ADO to connect to a MS SQL 2000 database and performs many reads on the database (no writes). If I watch the audit login and logout events in SQL profiler I can see that numerous requests to the app result in only 1 audit login event. However, if I ru...

Delphi - Using the TApplicationEvents OnShortCut event to detect Alt+C key presses

I am using TApplicationEvents OnShortCut event to get application keyboard short cuts in a Delphi program. Using the following code: procedure TForm1.ApplicationEvents1ShortCut(var Msg: TWMKey; var Handled: Boolean) ; begin if (Msg.CharCode = VK_F9) then begin ShowMessage('F9 pressed!') ; Handled := True; end; end; ...

Handling extended characters in Windows commands?

I am debugging a windows batch command file. It is failing when extended (> 0x7f) characters are used in the paths or file names. The problem seems to be related to passing parameters to a command file that is CALLed from another. For an example, this command works as expected: xcopy "Pezuñero\1 - 001.wav" \temp This does not: call ...

Reading MS Access mdb files in Delphi (for free)?

I'm looking for a Delphi component / library to open and read from an mdb (MS Access) database. I will not be writing to the db or displaying the data; just need to read the db using whatever sql Access supports. This is for a personal side-project (programming is not my paying job), so I need a free or a very inexpensive solution that...

what is the best free ftp component for delphi

I'm using delphi6, and our company don't want to upgrade it, and I found Tidftp lack the MLSD command, So what is the free ftp component you are using now? ps : I searched for one on Google, but I don't know which is stable and standard. ...

first chance exception: system error 8: not enough storage space to perform the command

how do i debug something like this? i need the debugger to stop and show me where the problem is. don't just show it in the event log & then hang. first chance exception: system error 8: not enough storage space to perform the command i'm using delphi 2009. the problem doesn't happen regulary. i'm not eager to pepper my program w...

Can a WSDL indicate the SOAP version (1.1 or 1.2) of the web service?

Delphi only supports SOAP 1.1, and includes a WSDL importer. Is there a 'litmus test' to see if a web service uses SOAP 1.1 or 1.2, based on the information in the WSDL? ...