delphi-2007

Best way to find if a string is in a list (without generics)

I want do something like this: Result = 'MyString' in [string1, string2, string3, string4]; This can't be used with strings and I don't want to do something like this: Result = (('MyString' = string1) or ('MyString' = string2)); Also I think that creating a StringList to do just this is too complex. Is there some other way to achi...

DoubleBuffered property beeing added in the dfm in Delphi 2009 does not exist in Delphi 2007

Does that mean that I can't share a Form between delphi 2007 and 2009? ...

ORA-01426: numeric overflow exception when executing stored procedure

I ported a Delphi 6 application to Delphi 2007 and it uses BDE to connect to an Oracle 9i database. I am getting an "ORA-01426: numeric overflow exception" when I execute a stored procedure. This happens randomly and if I re-run the stored procedure through the application with the same parameters the exception does not occur. The old D...

How can I remove the images in the TIWTreeView component in D2007?

How can I remove the default images on the TIWTreeView (in Delphi 2007)? The closed book, open book and the leaf page images. I know I can set them to other custom images, but when I try even just a 1x1 blank image it leaves a 16x16 space for the image. I just want the (+) and (-) images in the tree, with no open/closed/leaf graphics....

How can I determine the connection method of a Crystal XI report at runtime, before logging in?

In my (Win32) application, I am displaying Crystal Reports. I set the login information at runtime. However, Crystal kindly decided to refer to the database name by several different names, depending on how the report connects. For instance, if the report connects through an ODBC connection, then it is called "Data Source", but if it ...

Has anyone experience with porting a D2007 + TntControls application to D2009?

I have a rather large (freeware) project written with Delphi 2007 which is using both the TntUnicodeControls and the TntLXControls library and I'm planning to move to Delphi 2009. Unfortunatly I'm using those libraries everywhere in my project: Replacement for VCL controls to provide Unicode capability Win32 API wrappers (mostly for c...

Detect disk activity in Delphi

I'm using Delphi 2007. I am copying files to a remote drive. When the copying ends, I shutdown/standby the machine. It can happen that some files don't get copied from buffer to disk, and the remote disk gets disconnected, so the backup is not completed. I need to detect disk activity on that disk to properly be able to take the close a...

Why does Cut/Paste of form components sometimes stop working in Delphi 2007 IDE?

This is driving me crazy. I'm not going to take it anymore. I'm going to ask, even at the risk of eternal public humiliation! (If it's something really obvious or that I've done to the system myself). For reasons I've never quite had the patience to work out, every so often the form I'm working on in Delphi 2007's visual form editor goe...

Can I Use a .NET DLL in "Delphi 2007 for Win32"?

Is it possible to use a .NET DLL in Delphi 2007 for Win32? I've tried to import the DLL in the same way I've done for an ActiveX component, but it doesn't appear to work (Component Menu -> Import Component -> Import .NET Assembly. Is it possible and if so what are the steps? ...

Generate Code for Invisible ActiveX Object Event Handlers in Delphi

You know in Visual Studio you can use the "+=" syntax and a couple tabs to have it autogenerate the code for an event handler? How do I accomplish the same thing in Delphi? I'm trying to create an event handler for an event in an invisible activex library that I've imported using the Import Component function. I realize that with impo...

Setting Up Event Handler in Delphi 2007 and Getting "Parameter Lists Differ" Error

I'm trying to write a class in Delphi 2007 that uses a ActiveX library. The class will catch an event that the ActiveX library has to expose its own event that adds some information to the ActiveX library's event. The bottom line is that when I assign my own procedure to the ActiveX library's event that I want to use, I get an error: ...

Quick way to change a property on many forms in a Delphi project?

I thought there was something in GExperts to do this, but I can't see it if there is. I have to change the SCALED property (from the default of TRUE to FALSE) in each form in a project that contains about 100 different forms. Because the default value of SCALED is TRUE, it doesn't actually appear as a line in the .DFM file (when viewing...

How can I add an icon to an OCX made with Delphi so that it is visible in VB?

I made an OCX with Delphi 2007. Now my customer claims that there is no icon in his VB when he installs this OCX. How can I add such an icon to my OCX? ...

Can't find Delphi 2007 WSDL Importer

I'm may be missing something but I can't find the Delphi 2007 WSDL Importer anywhere. I've looked in New -> Other -> Web Services where it is supposed to be and all of the other sections as well (just in case) but it's not there. Does the WSDL Importer only ship with some versions of the IDE and not others? Has it been hidden somewhere? ...

Switching Control Types (but not names) for Lots of Controls on a Form in Delphi

I need to switch every control of a particular type on a form to a different type while maintaining the name and the code associated with each control. For example, let's say I need to switch a dozen or more TEdit fields to TSpinEdits. How can I do that in Delphi 2007 with minimal effort? ...

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...

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? ...

Accessing Variable in Parent Form from OnTimer Event - Getting Exception

I'm getting an exception in an OnTimer event handler (TTimer) that when executed increments an integer variable in the parent form. The timers need to be able to access an incremented integer used as an id. My first question is: How can I tell in Delphi 2007 which code is running in which thread? Is there a way in debug mode to inspec...

Are Delphi interfaces inherited in subclasses

If I implement an interface on a base class will it be inherited by its sub classes, I know the functions/procedures will be, but I am more interested in whether I will be able to cast the subclass to the interface and then back to its original class. What I am hoping I can do is pass objects of different base classes to a function, and...

How do I insert 800000 records into an MS Access table?

I need to insert 800000 records into an MS Access table. I am using Delphi 2007 and the TAdoXxxx components. The table contains some integer fields, one float field and one text field with only one character. There is a primary key on one of the integer fields (which is not autoinc) and two indexes on another integer and the float field....