delphi

Display a ToolTip hint on a disabled menu item of a popup menu

So I have a TMenuItem attached to a TAction on a TPopupMenu for a TDBGrid (actually 3rd party, but you get the idea). Based on the selected row in the grid, the TAction is enabled or disabled. What I want is to be able to display a hint to the user explaining why the item is disabled. As far as why I want a hint on a disabled menu i...

Accessing LocalApplicationData Equivalent in Delphi

Using Delphi, how do I access the equivalent of .NET's System.Environment.SpecialFolder.LocalApplicationData variable (which works on any version of Windows)? I assumed I could just do: dir := GetEnvironmentVariable('LOCALAPPDATA'); This works on Vista but XP doesn't seem to set that environment variable by default at least on my tes...

Delphi Library Path - what should really be going in there?

I've been putting the path to the unit (.pas) file folders of our packages into the Delphi Library path but I'm beginning to wonder if this is a mistake! Take this problem for an example: I have two home grown packages: LowLevelPackage HighLevelPackage HighLevelPackage uses units contained in LowLevelPackage. If the path to both pa...

Unit-testing Delphi data modules

If all the business logic is present in a datamodule (TSQLDataSets and TDataSetProviders) how would you refactor the code to make the application more appropiate for unit testing? ...

Very strange error in my app from component.

Ok my application does everything that is it suppeded to do and it does the same thing every time so its not as if testing was gone be that much trouble. it crashes "somtimes" not always. it does this when i hover the mouse over a file in the open file dialog i have recently outputted. not instantly it waits about half second to a seco...

Why Do Some Delphi Components Require "AOwner: TComponent" To Construct Them?

It seems completely irrelevant to require a TComponent as an owner to instantiate an object of some kind. Why are there so many Delphi components that require this? For example, TXMLDocument requires a TComponent object to instantiate. Why is this and if there's a good reason, what should I be using in there to "do the right thing"? ...

Delphi - How to set vertical scrollbar in TStringGrid, always visible

I'm using Delphi 2007 for Win32 and need to set the vertical scrollbar in TstringGrid to always be visible. How do you do that? ...

opendialog.onhint crash

I have checked 100% I am closing all handles on a file I recently created. But when I call "opendialog.execute;" the dialog pop up as usual but on the mouse over hint of a recently created file the entire thing crashes with a out of bounds error. I know this is not any of my out of bounds as if I open the file without causing a (onhint)...

What is the best GRID and TREE control?

What is the best GRID and TREE control for DELPHI win32. It should also be DB-Aware. I have use the DBGrid but it is very limited and lakes a lot of new features DevExpress as an impressive collection of tools and features, but a very high price. What is your GRID/TREE of choice its pros and cons, and of course its price tag. ...

How to tell if connected to internet

I wish to write a windows app which does something when I become disconnected from the internet. I was thinking of writing a very simple C#/Delphi app which simply polls every 20 seconds to see if I'm still connected. If I have to poll I'd really like a solution other than trying to download a web page from the net. I can't assume that ...

How do I gracefully exit a MDI form that has code executing in Delphi

I have a MDI application written in Delphi 2007. If the user exits a form within it whilst code is executing it causes an exception, because the code is trying to update a component or use an object that has been freed with the form. Is there anyway I can tell if code is executing in the exit event or is there a standard way to deal wi...

File / Folder monitoring

Hi; What is the best way to monitor disks against file activities. I mean that getting the full file name (c:\temp\abc.txt), action(created/deleted/modified/renamed), and also the user (user1) and process name (notepad.exe) causing the file (multiple delete) activities. I heard about Some APIs and ShellNotifications but could not use t...

What is the best Commercial Database Application

What is the best commercial database application to create the database structure for a simple local database with one linked table that can create Access, Paradox and dBase files these days? Access, FoxPro, other? Are there any free or inexpensive shareware applications that do not use the BDE to do this? ...

How to prevent form from being resized in Delphi?

How do I prevent my form from being resized? I don't want it to be maximized (which can be toggled via the property editor), but I don't want anyone to be able to drag-resize it. Am I missing something simple, or does this require a little bit of coding? I'm using Delphi 2007. ...

Adding a field to a cloned TClientDataset in DELPHI

Hi I have a master and cloned TClientData set CdsCloned.CloneCursor(CdsMaster,true); CdsMaster has two Fields 'SessionId' and ’UserID' CdsCloned will have the same Fields QUESTION: is it possible to add an extra field to CdsCloned without changing the CdsMaster ? ...

Get TChartSeries at XY Point in TChart

I'm using the TChart control that comes with Delphi 7 and wish to get the Series and Value # of the line/bar under the mouse pointer. I'm aware of the OnClickSeries event which provides great info but I really want this info when I hover over a series. EDIT: I found a hittest method on TChart which works with any series types and multi...

What's the best way to pass configuration to application agnostic modules?

I am working on an application that consists of several modules which in turn will be used in other applications as well. Each of these modules needs some configuration options, but should not be aware of the options of other modules, and also should not require other modules to exist. Some settings are shared between modules. Lets say ...

Recursive Class Instance Size in Delphi

Is there a way to get the actual size of a class instance in Delphi? I know about the InstanceSize method of the TObject class but that method does not recursively invokes itself for object members. For example, let's say we have two classes: type MyClass1 = class private myVar1 : integer; myVar2 : integer; end; type MyClass...

Focus not moved to inputbox() and box remains behind of apps (Vista)

How can I make my delphi systray app using standard vcl inputbox() function to request focus, now dialog box seem to remain in taskbar and dialog does not open to front of other apps. This is Vista issue I think. Creating own form would solve it I believe. ps: I can edit dialogs.pas if needed, it seem to be using Tcustomforms.showmod...

Delphi and XP embedded

Does anybody know if Delphi (Win32) works with XP embedded ...