delphi-2009

TMonitor synchronization / Application.ProcessMessages

Hello again! I'm back with another question concerning threads and synchronization. Imagine a server application that has to perform a lengthy operation and the client wants his GUI to remain responsive while he waits for the server's response. I thought of the following pattern: TMonitor.Enter (FTCPClient); try WorkerThread := TWorke...

Delphi 2009 OnKeyDown does not trap as Delphi 2007 does

Hello, I have this code procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); var begin if not (Key in [Ord('0')..Ord('9')]) then Key := 0; end; and it worked fine with Delphi 2007. When I upgraded to Delphi 2009 and I try to press any letter it is accepted and the Key := 0 does not trap the input? ...

Where Is TShellListView in Delphi 2009?

We have recently moved to Delphi 2009. I can't find the TShellListView and TShellTreeView controls. Do I need to install something extra? From searching the web it seems they are shipped with Delphi 2009 but for some reason they havent been installed. Has anyone had a similar problem? Update: This is so unbelivably idiotic. It ap...

Delphi 2009 Application using Large Icons for Vista

I want to use Vista Large Icon feature in my Delphi 2009 application, but I can only embed the normal 32x32 icon in my application. How can I make application have many sizes of Icons? Thanks ...

Delphi Generic constraints problem

I am trying to create a generic list class for use with tiOPF (an Object Persistence Framework for delphi @ www.tiopf.com). Specifically I am trying to take an existing generic class (TtiObjectList) and make a generic version that uses TtiObject descenants. I have limited scope for altering the base classes as they need to compile und...

TTreeView node handles freed after TTreeView's parent changed???

i have a very interesting problem. background i've used TTreeView for years but only now am using it with a docking library (from AutomatedQA). i've learned that when the parent of the TTreeView is changed, all the handles are recreated. this is something the docking library does during normal activites. i've been using the Data p...

Why can some arrays be published but not others?

type TStaticArray = array[1..10] of integer; TDynamicArray = array of integer; TMyClass = class(TObject) private FStaticArray: TStaticArray; FDynamicArray: TDynamicArray; published property staticArray: TStaticArray read FStaticArray write FStaticArray; //compiler chokes on this property dynamicArr...

Faster CompareText implementation for D2009

Hello, I'm extensively using hash map data structures in my program. I'm using a hash map implementation by Barry Kelly posted on the Codegear forums. That implementation internally uses RTL's CompareText function. Profiling made me realize that A LOT of time is spent in SysUtils CompareText function. I had a look at the Fastcode site...

Problem with with Delphi 2009 and copying memory

I'm testing DelphiModbus library on Delphi 2009 and don't get quite the results I want. I think the problem lies with the following line on IdModbusClient.pas: Move(Buffer, ReceiveBuffer, iSize); It looks like ReceiveBuffer is set to some garbage. Buffer is defined as TIdBytes (from Indy components) ReceiveBuffer is defined as TComm...

Saving strings to disk under Delphi 2009

Hi. I have a structure like below that needs to be saved and loaded from disk. RSecStructure= packed record Name : string[255]; {NEED UNICODE SUPPORT HERE} ScreenName : string[255]; OrigFileName : string[255]; Prim : string[255]; ...

Connect with TTcpClient through a http proxy

Hi all, How can i connect to a server through a http proxy server in delphi? What about SOCKS5 proxy? Google doesn't have any suggestion! ...

What is the best way to display a PDF file in Delphi 2009

What component should I use to display a PDF file in a Delphi 2009 application? EDIT: I have been using PDF Viewer by Synactis - a very nice free PDF Viewer But it has no Delphi 2009 support. So I need to designing it out of the product ...

Cannot install components that worked under D7 in D2009

Hi. I have lots of components that worked perfectly under D7. I managed to compile and install them by dragging them into the Delphi 2009 IDE. However, when I try to use those components in a project, the compiler says it cannot find the source code of them. Where I can enter the path to that library? Solution: I dragged and dropped...

Ribbon control bug? (causes cutoff in vista)

I've found that when I take a simple form containing only a ribbon bar and a status bar, it's cutoff. The control you see above the status bar was later removed. The same cutoff occurs whatever control happens to be present. Later I removed the status bar & put a memo control there instead with the same result. without ribbon bar: wit...

TDictionary - invalid key

I have code like this: type TMyDictionary = TDictionary<int, int>; var myDict: TMyDictionary; k, v: integer; // code to fill the dictionary for k in myDict.Keys do begin v := myDict.Items[k]; // other stuff end; Randomly I see an exception thrown on 'v := myDict.Items[k];' which says k is invalid. Anyone e...

Logging and Synchronization

I have just written my own logging framework (very lightweight, no need for a big logging framework). It consists of an interface ILogger and a number of classes implementing that interface. The one I have a question about is TGUILogger which takes a TStrings as the logging target and synchronizes the logging with the main thread so that...

Delphi 2009 SOAP request does not transfer user name with Windows Vista

We implemented a small application that uses the SOAP interface from Mantis Bugtracker (http://mantisbt.sf.net/). Mantis is installed on an SSL webserver that requires HTTP authentication. It works perfectly in Windows XP, but not on 64-bit Vista, where it fails with "Access denied". Looking into the server's access log, I can see that ...

Tools which can parse Delphi XMLDoc format and build online help

The XMLDoc tool for API documentation is explained here: http://edn.embarcadero.com/article/32770 Are there any free or commercial tools which can be used to create documentation based on Delphi's XML doc format? Is there a newer version of the 'getting started' documentation? This page refers to Delphi 2005 and third party tools, som...

How to get the index of a cursor in a cursor group in a res file

I have a routine that returns the number of cursors or icons in a group but how do you know which cursors or icons are associated with a specific group and how can you get the index of each icon in the group. Any help would be appreciated. ...

What data does a TObject contain?

TObject.InstanceSize returns 8, yet TObject doesn't declare any data members. According to the implementation of TObject.ClassType, the first 4 bytes can be explained as a pointer to the object's TClass metadata. Anyone know what the other 4 bytes of overhead are there for? EDIT: Apparently this is specific to D2009. In older versions...