delphi

Delphi project hierarchy comming from .net background

Comming from a C# background I'm now trying to learn Delphi. There are many similarities, but one of the first road blocks I'm facing now is my project hierarchy. In .net I've got the following Solution |-Project1 (.dll) |-Project2 (.exe) I used to also organise them like that in my folder structure. But I can't find the equ...

Delphi: How to Assign an Up Arrow Keyboard Shortcut to Action/MenuItem, and Keep It Actual for Navigating the List Control (ListBox/VTV)?

Hello! Please assist me: How to assign an up arrow keyboard shortcut to action or menu item, and keep it actual for navigating the list control (e.g. ListBox/Virtual Treeview/other) at the same time? Thanks! ...

initializing private var creates AccessViolation

Comming from a C# background I'm trying to learn Delphi. I encounter an Access violation when in my form I press a button that creates a TLight instance. Wherever I try to access my private FState I get an access violation. What am I missing? unit Light; interface uses sysUtils; type TLightStates = (Red, Orange, Green); type TLigh...

Where should a class free its private variables?

As there is no garbage collection in Delphi, where exactly do you unload variables? Say I have a type with a set of private vars. Would it suffice to have a Destroy method that does this work? Do I need to explicitly call this destroy method in my consuming classes? ...

Have a getter return the value of a private var's property

Say I have type TLight = class private Ftimer : TTimer; property IsAutoRotating: Boolean read Ftimer.Enabled; Obviously, this doesn't compile, but why not and how to solve this (preferably without keeping that state in a seperate var. ...

How can I detect which listbox item another item was dropped onto?

I have two listboxes. The listbox1 contains a list of the DB names. Listbox2, on the other hand, has a list the titles of the content associated by the DB on listbox1. Basically you click on listbox1 and it loads into listbox2 all the titles for the content of the DB. I want to implement now a drag and drop feature. I know how to drag b...

How to show a window that acts like a popup menu?

Hi, When window A is show, I want to show another none-modal popup window B, but: I don't want window A to become inactive due to window B becomes the front window; I want that when window B is focused, I pull down a combo box control on window A with one click (generally you have to click twice, one for moving the focus to window A a...

deploy application with OraOLEDB provider

I developed an application that uses Delphi 7, ADO and ORACLE, the provider I use is OraOLEDB (I need use this provider because the BLOB fields support). now I want to distribute this application with the provider. I search the web to download the Oracle provider, but has a size of 174 mb. I need to install this file on all client machin...

Hunting down EOutOfResources.

Question: Is there an easy way to get a list of types of resources that leak in a running application? IOW by connecting to an application ? I know memproof can do it, but it slows down so much that the application won't even last a minute. Most taskmanager likes can show the number, but not the type. It is not a problem that the ch...

Call UPS Parcel Tracking Web Service with Delphi?

Delphi 2009 imported the UPS WSDL without any errors, and I managed to invoke the web service with my account information and an example parcel ID. The response from the server is: <detail> <err:Errors xmlns:err="http://www.ups.com/XMLSchema/XOLTWS/Error/v1.1"&gt; <err:ErrorDetail> <err:Severity>Hard</err:Severity> <er...

Why do interface implementations based on TComponent leak memory?

This Delphi code will show a memory leak for an instance of TMyImplementation: program LeakTest; uses Classes; type MyInterface = interface end; TMyImplementation = class(TComponent, MyInterface) end; TMyContainer = class(TObject) private FInt: MyInterface; public property Impl: MyInterface read FInt write FI...

In my custom component, how can I augment the mouse-enter and -leave events?

Hi, I am making a custom Panel component which derives TPanel. I want for my new component to have some code executed on the OnMouseEnter and OnMouseLeave events, however, i do not know how to implement it. I see that TPanel has published properties OnMouseEnter, OnMouseLeave. How do i override those and add some of my own code? The...

Howto keep Delphi App Responsive during GUI Updates?

This question is about keeping the GUI responsive during longer-running tasks (a few seconds in most cases). I extensively use threads and a task pattern to execute expensive task in a background thread. But what about GUI updates that takes some time? For example, filling a large string grid or tree view? A thread does not help here be...

programatically extract the file name from a Download Link using delphi

How i can extract the file name from a Download Link using Delphi Example http://pj-mirror01.mozilla.org/pub/mozilla.org/firefox/releases/3.6/win32/es-CL/Firefox%20Setup%203.6.exe The result must be Firefox Setup 3.6.exe ...

programatically get the file size from a remote file using delphi, before download it.

How i can determine the size in bytes of a remote file hosted in the web, before download it, using Delphi? Thanks In advance. ...

Download a File from internet programatically with an Progress event using Delphi and Indy

I need a way to download a file from the Internet using Delphi via HTTP, Wich include an Progress event , I'm looking for a method wich uses the Indy components. I am using Delphi 7. Thanks in advance. ...

My Application's Auto-update utility is triggering Anti-Virus

I've created an auto-updating application which is distributed to 100s of users. The auto-update utility is being flagged by 55% of antiviruses on virustotal ( link ). My application was created in Delphi 7. Most of the flags are saying that this is Generic trojan/malware, obviously the software isn't actually malware (I'm the only one...

Incorrect "Unable to start debugging...Unable to attach to ASP.NET worker process" message in Delphi 2007 for .NET

I have seen this for a long time, and finally decided to put the question up here. I have some applications that I need to maintain that were written in Delphi 2007 for .NET (ASP.NET 2.0). Normally, the first time I run the application (using IIS) I get the classic "Unable to start debugging on the web server. Unable to attach to ASP.NET...

Simple code analyzer

Need a simple code analyzer to see if I am forgetting to free objects and classes, or to see if I am releasing them to many times. ...

Video component for delphi 2010

I'm moving a project from D7 to D2010 (and from XP to Win 7). I use a freeware video component to bring in video from a webcam (Video for Windows) and take a snapshot. Before I look to port this to 2010, I was wondering if anyone knew of a cheap video component that is 2010 compatible? ...