delphi

Windows Service: Do work at specified times (Delphi)

Just checking if there's any best practice when writing a Windows Service. The Service (Single-thread) needs to work at specified time intervals, right now I can only think of: Use sleep(), then check the time in a loop? Use a TTimer? Any advice? ...

Crystal XI Rel2 RDC Parameter Passing

Hi! I have the following setup: Delphi 5 Enterprise Update 1 Crystal Reports Developer XI Rel2 (RDC 11.5) After long hours of trial&error I can now set the logon stuff as asked earlier but when I try to set crystalparameters by code - it does not work and I get an empty report. I've written a small app for testing (here's just a sn...

Testing D2009 application with Test Complete 7.0

We are trying to use Test Complete 7 to test an application compiled in Delphi 2009 (recently ported from D2006). In theory this should be really easy - you compile your app with debug information, then user a stripper utility to strip the debug info out into a separate *.tds file. TC should then have access to all the properties and met...

Image list loading fails on Delphi 6 and Vista service pack 2

Delphi 6 on Vista service pack 2 seems that can't load imagelist from dfm and save back again in the IDE. The project with the dfm corrupted can't be rebuilt. the error when I run the project is: EReadError Error reading imagelist1.Bitmap: Failed to read ImageList data from stream any suggestion? thanks in advance ...

Vista/Win7 Delphi Audio device information

Hi guys, is there a way to get all Audio device names with delphi(D2009) on Vista or Win 7, I managed to get the number of devices, and to get the device PropertyStore using IMMDevice, but I wasnt able to go forward :| Thanks a lot ! ...

File Open Dialog with Encodings combobox under Vista.

I currently use the TOpenTextFileDialog as it has the Encodings option, but under Vista it appears using the older open dialog style. I'd like the new style open dialog, but with an encoding combobox that I can fill with custom strings. Basically I want the exact open dialog that Notepad shows under Vista. Of course I also need the co...

Adding or inserting an item to a TListView always adds it to the end when GroupView is Active

Hi, In Delphi 2009 : When TListView's GroupView is Active, adding or inserting an item to a TListView always adds it to the end of the list, regardless of Index specified as param. When GroupView is set to false it adds it at the specified index. But when it is true, this behavior is not seen. ListView2.Items.Insert(1) The above ...

Getting LastAccessTime with Delphi

I am currently using the following guidelines to get a file's "LastAccessTime" with Delphi http://www.latiumsoftware.com/en/delphi/00007.php Using FindNext, have access to a TSearchRec object from which I can access ftLastWriteTime which is of type TFileTime when converting this to a TDateTime object (using the above source) and then o...

Windows and Hints in Delphi

Hello again! This morning I finally made my mind and decided to ask you for help. Problem is that in my Delphi application no hints are shown at all... I have read about THintAction problem, I have read guides/tutorials/manuals, tried to invoke Hint windows ( firing event handlers ) manually, but nothing worked. They just doesnt show. I...

Using FindVCLWindow to call WinHelp32 (WinXP Pro SP3 32bit) in Delphi

what is wrong there? procedure TForm1.VCLHelpClick(Sender: TObject); var Ctrl : TWinControl; begin Ctrl := FindVCLWindow(Mouse.CursorPos); if Ctrl <> nil then if Form2.Cursor = crHelp then begin if Ctrl = CreatorEdit then Application.HelpCommand(HELP_CONTEXT,001); if Ctrl = EditorEdit then Application.HelpCommand(HELP_CONTEXT...

Calling a Delphi DLL from C# containing Pointer in struct not working

I have a delphi dll that is defined like this type tSSL_connect = packed record pssl : Pointer; pctx : Pointer; sock : Integer; end; function SSLCLT_Connect(pIPAddr: PChar; iPort: Integer; var pConn: tSSL_connect; iTimeout: Integer; bEnableNonBlockingMod...

Formatting a float to ###.## (two decimals)

Having : var Difference: DWORD // difference shows in milliseconds // List.Items.Count can be any 0 to ######## [...] sb.panels[2].Text := FloatToStr((((List.Items.Count) / difference) / 1000)); I want to format the resulting text to any ###.## (two decimals). Using FloatToStrF is no success (does'nt seem to work with DWORD). Tha...

How can I represent a coordinate grid in Delphi?

I'm trying to represent a two-dimensional coordinate grid with a two-dimensional array. Problem is, declaring the array flips the X and Y coordinates because of the way Delphi allocates the array. This makes it difficult to read elements of the array. For example, the following program gives a range check error while trying to print: ...

OpenIL (DevIL): Using ilLoadL from Delphi

Hi, I'm trying to manipulate an image that I receive to a function as TStream. I want to load it from memory and avoid writing to files. input variable declared as: inImage: TStream; "lump" variable declared as: imgLump: Array of TILubyte; in the function I do as follows: // setting input image into a "lump" SetLength(imgLu...

ListBox long items hints

There's a ListBox with some long items. These long items are getting beyond the right edge of the ListBox and here comes an idea to show hints for such items when the mouse is over them. I've found an example: procedure TForm1.ListBox1MouseMove (Sender: TObject; Shift: TShiftState; X, Y: Integer) ; var lstIndex : Integer ; begin with...

String to TStream

I'm attempting to convert a string to a TStream. My code below gives me an "Abstract Error" message on the CopyFrom line. I'm against a brick wall here, any ideas on how to solve this? procedure StringToStream(const AString: string; out AStream: TStream); var SS: TStringStream; begin SS := TStringStream.Create(AString); try ...

How to create temporary file (0x100) to accelerate application

I have seen that Windows system use temporary files to increase the performance of some tasks. Those files are marked with the 0x100 attribute when i look at them. I have got the following text from Microsoft: " By using CreateFile() with the FILE_ATTRIBUTE_TEMPORARY flag, you let the system know that the file is likely to be s...

Creating Compressed (Zipped) Folder using Delphi

Can I create Windows XP's Compressed (Zipped) Folder using Delphi? ...

Delphi 2009 command line compiler using dcc32.cfg?

Hi, In Delphi 2009, how can I build a project using command line. I tried using the command line compiler and supplying -a -u -i -r in dcc32.cfg file. But compiler is not recognizing the paths and throwing the error required package xyzPack is not found. -aWinTypes=Windows;WinProcs=Windows;DbiProcs=BDE;DbiTypes=BDE;DbiErrs=BDE ...

cast TObject using his ClassType ?

Hi guys, how can i make my code to work ? :) i`ve tried to formulate this question but after several failed attempts i think you guys will spot the problem faster looking at the code than reading my 'explanations'. thank you. setCtrlState([ memo1, edit1, button1], False); _ procedure setCtrlState(objs: array of TObject; bState: boo...