delphi

Delphi - adjusting thread sleep time

Hi. There are several threads in my application that work in the background. They connect to database and execute some time consuming select queries. In most of cases these queries return only several records. From time to time, however, they may return tens of thousands records. All these are then processed in a loop. Because such sit...

How can I sanitize a string for use as a filename?

I've got a routine that converts a file into a different format and saves it. The original datafiles were numbered, but my routine gives the output a filename based on an internal name found in the original. I tried to batch-run it on a whole directory, and it worked fine until I hit one file whose internal name had a slash in it. Oop...

Should I use delphi tframes for multi-pages forms ?

Hello I have some forms in my application which have different "states" depending on what the user is doing; for exemple when listing through his files the form displays some data about that file in a grid, but if he clicks on some button the grid is replaced by a graph relating to it. Simply said, the controls in the form depends on th...

How to use two TSplitter with different aligns (Horizontal and Vertical) ?

I have a form with three sections, and I want to allow the users to resize them as they please There is one section on the left (which take the whole height) and one on the right that is again cut in two vertically. See below: 11|22 11|--- 11|33 Using one splitter is quite easy: Component1.align := alLeft Splitter1.align := alLeft Co...

Changing the color of dropdown items in TDBLookupComboBox

I want to change the color of the dropdown items in a TDBLookupComboBox (in Delphi 2007). This seems to be non-trivial due to the lack of an OnDrawItem event. Is there an easy way of doing this? ...

Is QuickReports included with Delphi 2009

The title says it all, we are considering moving from Delphi 7 to Delphi 2009 and would like to know if QuickReports is still included in the package? ...

ODAC and Unicode

Hi. I have problem with ODAC 6.2. In page about ODAC written that ODAC support Unicode. Now I use TOraSQl component and I connect to Unicode table in Oracle. I can not view Unicode data in table. I see only ANCII code. pls, help me. I think TOraSql doesn't support Unicode ;) ...

Transparency in TImage

When a new TImage is created it is transparent. After drawing objects to this image I would like to clear them. Note that I need to keep the image transparent as the TImage is being used as an overlay to another image. Some sort of "clear" function for the TImage would be best. I think I'm missing something simple here, I just could not...

How to temporarily turn off "snap-to" (anything) in Delphi IDE /visual designer (D2007)

Every once in a while this drives me crazy: I want to move a control to some precise location, WITHOUT any kind of "snapping" -- snap-to-grid, snap-to-guidelines, snap-to-border, etc... and Delphi won't let me. Is there a key combination that one can use while dragging to temporarily turn off any and all "snapping"? I seem to recall it ...

SetFileInformationByHandle in XP/2003 from Delphi?

The MSDN documentation for SetFileInformationByHandle refers to "FileExtd.lib on Windows Server 2003 and Windows XP". I managed to track down the library and .h file, which is available to download as the "Win32 FileID APIs 1.1" from: http://www.microsoft.com/downloads/details.aspx?FamilyID=1DECC547-AB00-4963-A360-E4130EC079B8&disp...

How can I get the Delphi IDE's Main Form?

I'm writing a property editor for Delphi and I would like it to show up on the correct screen for multi-monitor support. In order to position it, I would like a reference to the "main" form for the Delphi IDE. I've tried using the Application's MainForm property, and the Application object itself, but neither seems to work. I believe th...

Is it possible to get the size of the type that a pointer points to in Delphi 7?

I want to get the size of any "record" type in following function. But seems it doesn't work: function GetDataSize(P : Pointer) : Integer; begin Result := SizeOf(P^); // **How to write the code?** end; For example, the size of following record is 8 bytes SampleRecord = record Age1 : Integer; Age2 : Integer; end; But GetDataSize...

How can I find all empty try ... except blocks with GExperts grep?

In new versions of GExperts, the grep utility now supports more 'expert' expressions. I have not yet found a way to locate empty try ... except blocks in Delphi sources using regular expressions, how could I do this with the GExperts grep tool? ...

How to use Delphi to get email message text from Thunderbird

What I do now with Outlook: I receive email orders for products. I select a single or multiple emails in Outlook (a single order can have multiple emails associated with it) and then switch to my Delphi coded OrderManager program and click "Import". It uses Outlook's COM automation interface to read the text of each message, parses ...

Parity bit

Is there a elagant way with delphi (6) to remove the parity bit in a file. In this case every 9e bit. Cheers Ernest ...

How can I tell what monitor the Delphi IDE Object Inspector is on?

This is a follow up to http://stackoverflow.com/questions/967327/how-can-i-get-the-delphi-ides-main-form which I now have working. I'd like to go one step further and place my designer on the same form as the Object Inspector, for those who use the classic undocked desktop layout and may have the Object Inspector on a different screen ...

Convert Delphi Bitwise Operation to Cobol

How can this code be converted to COBOL? Result := GetSysColor(Color and $000000FF) The value types are DWORD, I guess it is a bitwise operation. ...

Is there a Delphi library which returns all effective source paths for a project?

For static code analysis tools, it is necessary to know all effective source paths for a given Delphi project, which are defined on project level and in the global IDE configuration. Is there a Delphi library which can collect this kind of project information? As far as I know, the registry settings for the Delphi IDE can be in differ...

Access Violation when assigning component property on Data Module

I'm on Delphi 2009, and my application contains a data module, which has a custom component named 'Globals' on it. In another form in the application, I'm trying to change a published property (a string) on the Globals component: dm.Globals.qhProject := _ProjectName.Text; //always gives access violation The _ProjectName control is ...

Getting Vista Folder Paths

Why will this not compile in Delphi 2009? unit VistaFolders; interface uses Windows, ShellAPI, ShlObj; type KNOWNFOLDERID = TGuid; const FOLDERID_ProgramData: KNOWNFOLDERID = '{374DE290-123F-4565-9164-39C4925E467B}'; // downloads folder var SHGetKnownFolderPathFunc: function( const rfid: KNOWNFOLDERID; dwFlags: DWORD;...