delphi

Frac function losing precision.

I have a TDateTime variable which is assigned a value at runtime of 40510.416667. When I extract the time to a TTime type variable using the Frac function, it sets it to 0.41666666666. Why has it changed the precision of the value and is there a workround to retain the precision from the original value ie. to set it to 0.416667. ...

Indy IdSMTP and attachments in Thunderbird

Hello! Using the latest snapshot of Indy tiburon on D2010. A very simple project like: var stream: TFileStream; (s is TidSMTP and m is TidMessage) begin s.Connect; Stream := TFileStream.Create('c:\Test.zip', fmOpenRead or fmShareExclusive); try with TIdAttachmentMemory.Create(m.MessageParts, Stream) do begin Conte...

Interface Marshalling in Delphi

I want to send Interface Ref of IVApplication from Visio Add-in to my other one COM server. But I have Ole exception. Now i do that: Code in Visio Add-in: var IStrm: IStream; hres: HResult; rhglobal: HGLOBAL; VisioAppl: IVApplication; begin hres := CreateStreamOnHGlobal(0, TRUE, IStrm); if Succeeded(hres) then ...

Check with code if FinalBuilder is running a script

Is it possible to check if FinalBuilder is running a script with code? I would like to make a small application that can remotely start building a project on a remote machine, but only if its not running a script already. regards, -Vegar ...

Display field from another table in SQL

I'm a newbie with SQL... Now I want to display some instances of AddrDistances from DevExpress CxGrid with SQL. Select Cast((DistanceAsMeters * 0.001) as Decimal(8,1)) DistanceAsKm, bold_id, created, fromAddress, toAddress From AddrDistance Where DistanceAsMeters = 0 and PseudoDistanceAsCostKm = 0 and not AddrDistance.bold_id i...

is there a way in delphi 2009 to make form controls private?

is there a way in delphi 2009 to make form controls private? eg: if i add a label at design time, i'd like for it to impossible for code outside the form to access the label. (does delphi 2010 have this?) ...

Optimize SQL with Interbase

I was inspired by the good answers from my previous question about SQL. Now this SQL is run on a DB with Interbase 2009. It is about 21 GB in size. SELECT DistanceAsMeters, AddrDistance.Bold_Id, AddrDistance.Created, AddressFrom.CityName_CO as FromCity, AddressTo.CityName_CO as ToCity FROM AddrDistance LEFT JOIN Address AddressFrom ON A...

Reading binary data from serial port using Dejan TComport Delphi component

Apologies for this question but I am a bit of a noob with Delphi. I am using Dejan TComport component to get data from a serial port. A box of equipment connected to the port sends about 100 bytes of binary data to the serial port. What I want to do is extract the bytes as numerical values into an array so that I can perform calculations...

How to Detect Forward and Back Mouse Button Events in Delphi?

If a mouse has other buttons in addition to the standard left/right/middle (e.g. forward/back), how can we detect those button clicks in Delphi? An example of how this is used is the Internet Explorer, where the forward/back button on the side of a Logitech or MS mouse cycles forward and back between any loaded web pages. This seems to ...

How to access a Cassandra distributed database from Delphi

I guess the title says it all. I am looking at whether Cassandra might be an option for a distributed database store for our server software. The server software is written in Delphi, but I'm having difficulty locating descriptions of how to access a Cassandra database from Delphi. Any help & suggestions welcome! ...

Delphi Phrase Count / Keyword Density

Does anyone know how to or have some code on counting the number of unique phrases in a document? (Single word, two word phrases, three word phrases). Thanks Example of what I'm looking for: What I mean is I have a text document, and i need to see what the most popular word phrases are. Example text I took the car to the car wash....

Edit CSS with Delphi

I use Delphi 2010 . I am using twebbrowser to load up HTML source and view it. Now I want to click on an area (background, links, etc) in the web browser and get the styling in the CSS file that styles the HTML. For example: I click on the H3 region and I want to be taken to the h3{ color: white; } in the CSS. Any help at all is much a...

How can I create a context menu for a Delphi component?

I want to create a context menu for Delphi components like TDBGrid, TTreeView or similar. How can I do that? ...

Delphi fsstayontop oddity

Here is the deal. Main form set to fsnormal. This main form is maximized full screen with a floating toolbar. Toolbar is normal form with style set to fsstayontop. Most fo the time this works as expected. The mainform displays and the toolbar floats over on top of it. Sometimes (this is a bugger to find a reproducible set of steps)...

Delphi 2010 buttons losing click event

I've been experimenting a quite strange problem using Delphi 2010. In one form (a quite complex one) some buttons are automagically losing the click event. I am not dynamically assigning the event or something (they are wired in IDE). The events are fired OK some times but suddenly (and randomly) some of them don't fire the events anymor...

Detect source of remote desktop connection

This question tells me how to detect a remote desktop session. Do anybody know if it's possible to find out from where the remote connection was initialized? -Vegar ...

Is there a way to make TRadioButton be Transparent?

I'm using delphi 2010 ...

Delphi 2010 variant to unicode problem

I am working on a DLL in Delphi 2010. It exports a procedure that receives an array of variants. I want to be able to take one of these variants, and convert it into a string, but I keep getting ????? I cannot change the input variable - it HAS to be an array of variants. The host app that calls the DLL cannot be changed. It is written ...

Update Custom Component when other components on a form are moved

I am looking at replacing an old custom form designer with Delphi's form designer. Our application used a custom program for generating forms that could be used our own report writer. It is difficult to maintain the old application and using Delphi for the form designer seems to be a good option. The application that uses this forms i...

Reading Excel spreadsheets with Delphi

I need to read from and write to Excel spreadsheets using Delphi 2010. Nothing fancy. Just reading and writing values from specific cells and ranges on different sheets. Needs to work without having Excel installed and support Excel 2007. Some things I've looked at: I've tried using ADO, which works OK for selecting everything in a...