delphi

Getting the number of rows and columns actually populated with data of a N x M Array

I am writing some matrix routines in Delphi and this problem came up. I have defined a real matrix thus:- RealArrayNPbyNP = Array[1..200,1..200] of Extended; I have populated this array with a 5 x 6 matrix. How do I query the array to get the number of rows (which in this case will be 5) and the number of cols (which in this case will...

Enumerate all Delphi classes that implement a given interface?

With the new extended RTTI in Delphi 2010, can a Delphi application (at run time) build a list of all classes which implement a given interface? ...

Fast scrolling in Delphi's Virtual Treeview

[This is an updated version of a question posted earlier, the previous title was Selecting node by index in Delphi’s Virtual Treeview.] After the better part of a day, I believe I've got the Virtual Treeview component (powerful but complex) working in a simple two table data aware fashion. Now, I'm trying to simply select the 1,512th...

How can use Ado. Net from Delphi Win32

Is possible to use ADO .Net from an Win32 Application build with Delphi 7. maybe using CrossTalk or Hydra? Any recommendation is welcome. thanks in advance. ...

Why should I care about RTTI in Delphi?

I've heard a lot about the new/improved RTTI capabilities of Delphi 2010, but I must admit my ignorance...I don't understand it. I know every version of Delphi has supported RTTI...and I know that RTTI (Runtime Type Information) allows me to access type information while my application is running. But what exactly does that mean? Is Del...

Unsafe cast in delphi sometimes gives a nil only on certain machines?

We have some code something like this (Delphi 6 RTL Update Pack 3): objChild1 := TChild1.create(); ... (Some Code) objProcessor.function1(objChild1); Tchild1 is inherited from TGrandPa through 2 + hierarchy levels. function1 is defined like this where objChildData is a private variable of TProcessor class and is of type TChild1 : TP...

How to make a controll stick to its parent borders on resize?

Hi, I have a TGroupBox as a parent and i want to place a button inside it, and make it so the button would stick to the top right corner of groupbox. The problem is, TGroupBox does not have the method OnResize, so i don't know how to tell a button where should it move after groupbox was resized. Is there any way to make it happen? T...

Delphi - Reverse Lookup ' who includes this unit'

I am debugging a large application distributed over many units. I ran into a compilation error in a low level unit and do not have the slightest idea in which part of the application this unit is referenced. Is there a way to use RAD studio 2010's IDE to create some kind of include-graph? As most of the units used are not part of the p...

TExternalThread, what the heck is it? "Cannot terminate externally created thread" when terminating a thread-based timer :/

This happens half of the time when closing my application in which I have placed a TLMDHiTimer on my form in design time, Enabled set to true. In my OnFormClose event, I call MyLMDHiTimer.Enabled := false. When this is called, I sometimes (about half of the time) get this exception. I debugged and stepped into the call and found that it...

ActiveX control not processing arrow keys correctly when hosted in Delphi application

I have an ActiveX control hosted in our application. The control was imported using Delphi Import component menu. The ActiveX control contains an edit box for user input. When I run the control in its own sandbox application(not a Delphi app) the arrow keys work as expected moving the cursor within the edit control. However when I run...

How do I install the latest Indy10 in Delphi 2007 for .NET?

Can someone please point me to instructions for installing the latest Indy10 in Delphi 2007 for .NET? I'm not exactly sure how that works for the .NET side. Currently, I use the Indy10 assemblies that shipped with Delphi 2007. I have the latest Tiburon branch of Indy10. My preference would be to build directly from the Pascal source...

Can a TImage handle a 32bpp JPG Image?

For some reason, when I load a JPG image at design-time, the image shows as a grey scale image with vertical bars reminiscent of TV scan lines. and the image is not sized properly. The image is 500x364 32 bpp, and previews beautifully. Is there a limitation of TImage in terms of colour depth? ...

Delphi: Running multiple forms

Alright, so I'm trying to create a "text-based" game on Delphi 7 (OS: Windows XP sp2). Basically, my problem entails running multiple forms: Gladiator_main Gladiator_console - which is more of a "Create new/Load character" form Gladiator_Armory - the stat's page Gladiator_Arena - where the battle report is to be output... Obviously, I...

Delphi 2010 Error Insight incorrectly flags "Undeclared Identifier"

In D2010, Error Insight is incorrectly underlining in red types like "TOpenDialog" (even though my unit and project's uses both include Dialogs). Also, in my method TMyFrame.Foo, it fails the same way by flagging a reference to a VCL component in my TMyFrame -- even though Foo and the component are both part of TMyFrame. SO suggested ...

Why can't I register this method with the PascalScript compiler?

My question is below. Here is my setup: interface uses windows, {...,} uPSComponent_Default, uPSComponent, uPSRuntime, uPSComponent_Controls; TForm1 = class(TForm) //... PSScript1: TPSScript; PSImport_Classes1: TPSImport_Classes; PSImport_Controls1: TPSImport_Controls; procedure PSScript1Compile(Sender: TPSSc...

Handling item checked in a TListView descendant.

I have a TListView descendant which introduces additional features like sorting and loading from a dataset. I now wish to modify the class so that whenever an item is checked or unchecked it is added or removed in an internal list of checked items so that an application using an instance of the component can easily read the number and l...

Delph/Builder drag and drop with image, image disappears when leaving control

I have a tree control that implements drag and drop. I use an overridden OnStartDrag() to get my own TDragObjectEx that shows an image while dragging. This works perfectly within the tree control, but as soon as I leave the tree control the image disappears. The cursor stays though. I tried implementing OnDragOver, to reset the image...

Derive IntraWeb forms from parent and not TIWAppForm directly - error in IDE

I have forms in my application that I derive from a common ancestor, like: TAtFormBaseIW = class( TIWAppForm ) and TAtFormExplorerIW = class( TAtFormBaseIW ) This works for certain forms, but not for others. Let me make a wild guess: it seems to work for all forms that where created in Delphi prior to IW 10, but not for forms I crea...

Intraweb application in IE8 loses IWEdit.Text in OnAsyncChange

I have an application using IntraWeb 10 and Delphi-2006 that works perfectly using Firefox or Chrome, but misbehaves using IE 8. I am using templates on my forms to give the designer some freedom over the placement of the main components on the screen, mainly regions and menus. Within the regions I do not use frames. Several components ...

Is learning the Caché database hard coming from relational databases and object oriented programming language like Delphi ?

I am currently running the local version of Caché on my system in order to determine if I can (and will) take on a new possible project. The current project uses Delphi 7 as a front end calling a Caché dll where the business logic is stored in the database. I have a background of Sqlserver and Firebird (and before Access and Paradox) a...