delphi

Connecting to Squid server using NTLM auth with Indy components

Hi, Has anybody managed to successfully connect to a https location via Squid proxy server setup with NTLM authentication, using Indy (10.XX) components? I can successfully connect to http locations, however with https Indy returns an EAbort error. Also, I can access http/https equally well if I use FreeProxy as the proxy server (with...

Should I put a try-finally block after every Object.Create?

I have a general question about best practice in OO Delphi. Currently, I put try-finally blocks anywhere I create an object to free that object after usage (to avoid memory leaks). E.g.: aObject := TObject.Create; try aOBject.AProcedure(); ... finally aObject.Free; end; instead of: aObject := TObject.Create; aObject.AProcedure(...

How should I re-raise a Delphi exception after logging it?

Do you know a way to trap, log, and re-raise exception in Delphi code? A simple example: procedure TForm3.Button1Click(Sender: TObject); begin try raise Exception.Create('Bum'); except on E: Exception do begin MyHandleException(E); end; end; end; procedure TForm3.MyHandleException(AException: Exception); beg...

How to Get Control Panel Categories (Groups) on Windows Vista and Windows 7

Is there a way to get a listing of control panel categories on Windows Vista and Windows 7 using the shell? Is there a way to determine which category an applet is assigned to using conical Names using the shell? such as Microsoft.Mouse is in which category? I have some code that works nicely to display control panel applet names obta...

How to merge two menus in a MDI application.

Hi. Anybody knows how to merge two menus with the same name in a MDI application. More exactly, in the MDI main form I have a menu called 'File' which has a sub-menu called 'Load project'. In the MDI child form, I have a menu called also 'File' which contains a sub-menu called 'Save project'. How can I force my application to show both...

Manually Writing the HTML in TWebBrowser Pt. 2

As the name suggests this is a continuation (sort of) of http://stackoverflow.com/questions/2784679/manually-writing-the-html-in-twebbrowser This time around I'm trying to add some auto-refresh logic to the HTML I get. I have pieced together an approach from several sources (see below). In short, I am trying to locate the title node and...

Delphi connection to OpenEdge Progress-4GL Database

Folks: Has anyone had success connecting to a Progress-4GL database with Delphi?   I've been unable to establish any connection with the ODBC driver provided by the vendor (Progress OpenEdge 10.1C Driver). I've entered (what I believe are) the right parameters, but keep on getting an error whenever I test the connection: "[Data...

Add code before initialization of units in Delphi

Is there a place where I can add code that will be executed before unit initialization? The reason I want to do this is I need to change the DecimalSeparator, this has to be done before the initialization of some units. I have put it in the project source, before Application.Initialize but it is too late by then. As I see it the only ...

Difference between the WaitFor function for TMutex delphi and the equivalent in win32 API

The documentation of delphi says that the WaitFor function for TMutex and others sychronization objects wait until a handle of object is signaled.But this function also guarantee the ownership of the object for the caller? ...

Delphi: Multiple tokens edit component

Hello, I'm looking for an enchanced edit component that allow users to input multiple tokens (items) manually separated by some symbol, or to select them from another source. It's something like "TO" field in outlook or facebook that allow you to input multiple recipients. Can anyone suggest any solution? Thanks in advice! ...

How to run "Find" in AcroPDF?

Hi, I have TAcroPDF (ActiveX) component and Edit1 on the Form1 I would like AcroPDF to find some text typed in Edit1. Does anybody knows how to do it? Thanx ...

How to get font size in delphi

Hi, I am looking for a function which should take parameters as Font name, sample character, width, height of the sample character and should return Font Size. It must look like this: GetFontSize(<Font Name>, <Sample Character>, <Sample Character Width>, <Sample Character Height>) which must return the font size,...

How to get a component's parent form in Borland VCL?

Hi, I'd like to determine which form a given component belongs to in my application. Neither the Parent nor the Owner property can be assumed to be the form itself, so I can't simply use this. I guess I could just go through the Parent property recursively until I arrive at something derived from TForm, but is there a better way to do ...

How to call in C# function from Win32 DLL with custom objects

How to use in C# function from Win32 DLL file made in Delphi. When function parameters are custom delphi objects? Function definition in Delphi: function GetAttrbControls( Code : PChar; InputList: TItemList; var Values : TValArray): Boolean; stdcall; export; Types t...

Delphi: TAdoTable.Insert not really an Insert?

Hi, I have two ADO Tables linked as master/details tables, tblCategory (master) and tblItems (details). Both tables have its own grid, and displayed in the same form. I also have data aware controls (dbedits). Say, currently I'm at: Category=Books, No of Items=10 records, and pointing at record number 5 in the grid. I want to add a new ...

What's wrong with this code to un-camel-case a string?

Here is my attempt to solve the About.com Delphi challenge to un-camel-case a string. unit challenge1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type check = 65..90; TForm1 = class(TForm) Edit1: TEdit; Button1: TButton; procedure Button1Click(Send...

Delphi. How to monitor URLs being downloaded by IE?

When you're opening page in IE it downloads lots of files, including CSS, scripts, pictures, SWFs, etc. I need to develop small plugin which will monitor all these URLs and let's say save to file this list. I need it in Delphi, but any example in any other programming languages will be really appreciated. ...

Distributing Delphi Application which uses an ActiveX control

What's the best way to package the activex dll with the delphi application? If I just compile it, when I send it to somebody else it gives them errors because they don't have the ActiveX dll registered. ...

Optimize included files and uses in Delphi

I try to increase performance of Delphi 2007 and Codeinsight. In the application there are 483 files added in the DPR file. I don't know if it is imagination but I feel that I got better performance from Codeinsight by simply readd all files in the DPR. I also think (correct me if I'm wrong) that all files that are included in a uses s...

When should I add a file reference to a Delphi project ?

Unit files for standard VCL files like Dialogs, StringUtils etc is never referenced in a projects DPR-file. But when should I add a reference to the DPR-file ? Now I have own sourcefiles and source of own components. What about source files for Ravereport, Devexpress, Indy, Gnostice etc ? I want as fast codeinsight as possible, but of c...