delphi

Bluetooth on Lazarus/FreePascal on Mac OS X

Has anyone used Bluetooth on Mac OS X with Lazarus or FreePascal? There is a bluetooth unit, but it currently only supports Linux. Information about existing unit: http://wiki.freepascal.org/Bluetooth I plan to enhance this to support Mac OS, but it would be nice to know if anyone has written any code to use BlueTooth on Mac OS alread...

How to hide a value on the registry (like sysinternals RegHide tool)

I've read about the possibility of hiding a registry value on the registry using a technique documented by Sysinternals that lets you put a null character in a registry key using the native API (eg, "hello\0"): http://technet.microsoft.com/en-us/sysinternals/bb897446.aspx (scroll to the "Hidden Registry Keys" part). They also have a too...

How to get performance data from a remote computer using Delphi

Hi Given that I have the appropriate rights, how can I get performance data (ie. 'Pages/Sec', 'Avg. Disk Queue' and so on) from a remote computer? Basically I want to write a function like this: function GetPerformanceData(aComputerName, aPerformanceIndicator: string): variant; It is preferably (of course) to work out of the box on ...

How to determine if the mouse cursor is inside a control

I'm adding support for mouse wheel movement to a TScrollBox (using the FormMouseWheel procedure) and I need to determine if the mouse is inside the component. Basically I need to determine if the mouse is inside the TScrollBox so that I then handle the scrolling code accordingly. Any idea on how to do this? EDIT: Here's the code (incl...

How to use argument in a cast with Delphi

How to do this in Delphi: procedure ToggleVisibility(ControlClass : TControlClass); var i : integer; begin for i := 0 to ComponentCount - 1 do if Components[i] is ControlClass then ControlClass(Components[i]).Visible := not Control(Components[i]).Visible; end; Compiler doesn't allow the cast in this case. Any ideas? I'm...

Delphi: generic and type constraints

Is it possible to constrain the type of generic to, say, two different classes? Like so: TSomeClass<T: FirstClass; T: SecondClass> = class // ... end; (Sorry about the lack of formatting - the SO tool bar has disappeared from my browser). I know the above won't compile, its only written so to give you guys an idea. I tried TSomeCl...

How to catch scrolling event in DBGrid in Delphi

I have a DBGrid, I need to run some code, each time the horizontal scrollbar is used. I couldn't find such event in DBGrid. Can you advise something? ...

Delphi 2009 causing shell32.dll errors?

I have a user that started experiencing access violations related to his shell32.dll file when using my software. This started to occur after upgrading to the latest version of our software, which is the first version we released that had been compiled in D2009. No one else is reporting these AV problems, and I have been unable to repl...

Querying for an Unknown Interface Type

In this code: TTest<IntfT: IInterface> = class protected fObj : TInterfacedObject; public function GetVal: IntfT; end; How would I implement the GetVal function if I want it to return fObj as an IntfT? I've tried: result := fObj as IntfT; and fObj.QueryInterface(IntfT,result); and result := fObj as IInterface; but noth...

When did my application start running?

What is the function to get date and time an application was executed? I'm using Delphi. ...

working with Delphi and Access

hi all I want to write an app that uses a Access database (*.mdb). I know how to connect to a mdb and how to use SQL statements. My problem is that I want to put the result of a query into a TListView. Any info/link/book is welcomed :) ...

TBitmap drawing transparent image in Delphi 2009.

Hi, Problem in drawing a semi transparent PNG image on TBitmap object. If the TBitmap's ,HandleType is set to bmDDB, then the canvas is drawn transparent. But the problem is it doesn't work on all kinds of machines (for ex: Windows on apple computers). When a TBitmap's HandleType property is set to bmDIB, canvas background is drawn wh...

How to write a Remote DataModule to run on a linux server?

Hi, i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service writen in pascal. The 'not so' big picture: I´m trying to write a php to emulate a SOAP Midas packets to ClientDataSets in delphi, but ...

How to avoid a thread freezing when Main Application is Busy

Hi, I'm having a bit of a problem. I want to display a progress form that just shows an animation on a when the main application preforms heavy operations. I've done this in a thread and it works fine when the user isn't preforming any operations. But it just stops when my main application is busy. I'm not able to put Application.Pro...

What are the ways of interchanging string data between clients and a server in Delphi?

I have a server and some clients (about 50) in an intranet. The clients send short (about 40 character) string data to the server and the server answers with a similar string. There are up to (but not permanently) 2-3 requests per second for each client. The server has to serialize the requests to get the response strings. The system sh...

Help with strange Delphi 5 IDE problems

Ok, I'm going nuts here. For the last (almost) four years, I've been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl floating point errors on compiling occasional deletions of my source code files form and object sizes shifting between instances of working on...

determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta had a problem with my app failing precisely in this area. my app is used globally. some of this code may have become obsolete since d2009...

How can I paste arbitrary data into a TMemo?

Copying and pasting text is easy enough, since it's built into TMemo, but it seems that it can only handle text. Seems to me that any kind of data can be represented as a string, though. If I copy some arbitrary data from another program and want to paste it into a TMemo, how do I get Delphi to accept it as a raw string? ...

Is there a Delphi IDE plugin for XML file editing, validation, formatting?

Are there (free or commercial) IDE editor plugins for Delphi which show valid XML tags and parameters automatically while editing (like CodeInsight for HTML does it already) or suggest the correct closing tags, matching the current open tag? validate a XML file in the IDE editor against its XSD, or to check its well-formedness? format...

How to start/stop a monitoring Delphi thread on demand?

I've been looking for a way to monitor for specific registry changes in Delphi. Found a solution at about.com: procedure TRegMonitorThread.Execute; begin InitThread; // method omitted here while not Terminated do begin if WaitForSingleObject(FEvent, INFINITE) = WAIT_OBJECT_0 then begin fChangeData.RootKey := RootKey;...