delphi

Weird results using P4COM

Hi I'm using P4COM to communicate with our perforce server. I have written an little utility to simplify our QA of what files have changed from one release to another. I have been using the P4COM interface from Delphi. So far so good. I though it might be nice to allow users to view the diff between the two versions of the file from...

Extracting PNG images from Delphi 2009 imagelist

The TImageList of Delphi 2009 has support for PNG images by adding them in the imagelist editor. Is there any way to extract a TPngImage from a TImagelist and preserving the alpha channel? What I want to do is actually to extract the images from one TImageList, make a disabled version of them and then add them to another TImageList. Dur...

Stopping a function from been overridden in Delphi

How do I stop a function/procedure in a superclass from been overridden in a subclass in Delphi (2007)? I want to mark it so it can not be altered, I believe there is a final keyword but can not for the life of me find the documentation for it, so I am not 100% sure that's what I need. ...

Time math in Delphi

I have a pretty unusual problem (for me). I am writing an application that will allow a user to change their system time forward or back either by explicit date (change my date to 6/3/1955) or by increment using buttons (go forward 1 month). I'm writing this to help some of my users test some software that requires jumps like this in ...

RTTI in Delphi

I'm trying to parse objects to XML in Delphy, so I read about calling the objet's ClassInfo method to get its RTTI info. The thing is, this apparently only works for TPersistent objects. Otherwise, I have to specifically add a compiler directive {$M+} to the source code for the compiler to generate RTTI info. So I happily added the dir...

ActiveX events between apartments

Environment: VS2008 (ATL), Borland Developer Studio 2006. Hello all. I'm having some troubles with ActiveX control events. Here is a brief description of my app architecture: There is an inproc COM server which contains STA ActiveX control (aka control) and MTA COM object (aka object). Here is the IDL definition of the control an...

Delphi 2009 Ribbon Controls - Glass Frame

I've been starting to use the new inbuilt Ribbon controls in Delphi 2009 and use the custom frame so the Application button and Mini-toolbar slide up onto the Window Frame, but I'm wondering if on Vista it should use the glass effect like Office 2007 does, and if so how I would enable this setting. Thanks for any help. ...

Using TTreeview as a menu

Im using delphi's ttreeview as an 'options' menu. how would i go upon selecting the next node at runtime like a previous and next button? i tried the getprev and getnext methods but no luck. ...

Interface "recursion" and reference counting

I have a small problem with interfaces. Here it is in Pseudo code : type Interface1 = interface end; Interface2 = interface end; TParentClass = class(TInterfacedObject, Interface1) private fChild : Interface2; public procedure AddChild(aChild : Interface2); end; TChildClass = class(TInterfacedObject, Interfa...

Looking for a Complete Delphi (object pascal) syntax

I need a complete Object Pascal syntax (preferably Delphi 2009). Some of the syntax is given by the help files, but not all information is provided. So I started collecting loose bits of information. Recently I added these to a more or less complete syntax description (EBNF like). Although it looks extensive, there are still bugs and I'...

In Delphi 7, can I set up 'Debug' and 'Release' modes?

In most modern IDEs, you can have Debug and Release build configurations, and you can quickly switch between them. In Delphi 7, this does not seem to be possible. I have to go to Project Settings and toggle optimization and all the debug information stuff manually. It would be great if there was a plugin or some such that handled this ...

array of tserversocket

OK I have an array of tserversocket and am using the tag property to keep track of its index. When an event is fired off such as _clientconnect i am using Index := (Sender as TServerSocket).Tag; but i get an error that highlights that line and tells me its an invalid typecast. What am I doing wrong if all I want to do is get the tag prop...

How do you disable the CPU window in Delphi 7

When stepping a program in Delphi 7, the CPU window sometimes pops up and then steps through that instructions. I find this an annoyance as I wish to only step Pascal Code. Does anyone know how to disable this CPU pop-up? I would not be sorry if this window never ever shows. It did not happen on Delphi 5 which was my previous IDE t...

How to Pass an Object Method as a Parameter in Delphi, and then Call It?

I fear this is probably a bit of a dummy question, but it has me pretty stumped. I'm looking for the simplest way possible to pass a method of an object into a procedure, so that the procedure can call the object's method (e.g. after a timeout, or maybe in a different thread). So basically I want to: Capture a reference to an object'...

Why does my Delphi 7 Debugger randomly decide to stop accepting certain keyboard input

Maybe this is an overarching question as I've seen similar bugs in Firefox and I'd like to know how to avoid coding them. For no apparent reason, the function keys, arrow keys (de-numlocked numpad as well), the 6 keys over the arrows, and backspace stop working. Every other key seems to work leading me to think it's some sort of interr...

Hashtable implementation for Delphi 5

Do you know a good and free Hashtable imlementation for Delphi 5 ? I need to organize a huge amount of data in a hastable and I am bit worried about memory leak issues that I found in most available implementations on the web. Tks ...

What language or RAD IDE do you recommend for building shareware?

I'm looking for an IDE for developing commercial desktop applications to be sold over the internet, as a mISV. Windows is a must, while Mac is a nice to have. An important factor is that the technology allows me to create beautiful native UI with ease. .NET has a large VM dependency that I'm not crazy about. I was thinking about Delphi,...

Change today's date, advancing one month and setting the systemtime

I would like a code sample for a function that takes a tDateTime and an integer as input and sets the system time using setlocaltime after advancing that tDateTime by (int) months. The time should stay the same. pseudo code example SetNewTime(NOW,2); The issues I'm running into are rather frustrating. I cannot use incmonth or simila...

Can Delphi 2009 in English and in French coexist on the same machine?

Does anyone know (like in tried and succeeded) if I can have D2009 both in English and in French? It's not so much to generate French or English applications but to have the IDE available in either language to take screen shots and make demos in French or in English. What would be involved: complementary install plus some shortcut par...

Delphi versus C++ Builder - Which is Better Choice for a Java Programmer Doing Win32

I'm a pretty experienced Java programmer that's been doing quite a bit of Win32 stuff in the last couple of years. Mainly I've been using VB6, but I really need to move to something better. I've spent a month or so playing with Delphi 2009. I like the VCL GUI stuff, Delphi seems more suited to Windows API calls than VB6, I really like...