delphi

Anyone encountered a INT 3 debugger break in mscorwks.dll?

We host the .NET runtime as part of a Win32 program, and lately it has begun to consistently break at a specific address, in mscorwks.dll. At the specified address, there is a 0xCC byte, which is a INT 3 instruction, which fires the debugger. Has anyone else seen this? I can't see enough information in the dll to know specifically whe...

How to find and remove unused Delphi packages from a project

How to find and remove unused Delphi runtime packages from a project that uses packages? I have a Delphi project that is made up of several packages, in the requires part of the packages there are several Borland/3rd party packages listed (rtl.dcp, vcl.dcp ect) I know I need most of them, but there are ones I know I don't need that have...

What is your favorite Delphi open source functional testing tool?

I'm aware of Selenium which is a very good open source automated website testing tool. Is there any equivalent open source tool to provide functional testing for Win32 GUI Delphi Applications? After a quick Google I've found this one : EFT So my question is what is your favourite functional testing tool and why? ...

Casting a TWebBrowser as a TWinControl

Can anyone tell me why the second cast fails to compile in Delphi 7? var WebBrowser: TWebBrowser; begin WebBrowser := TWebBrowser.Create(Self); TWinControl(WebBrowser).Parent := Self; (WebBrowser as TWinControl).Parent := Self; // fail here end Parent in TWebBrowser is a read-only IDispatch property, but why does the first cas...

Delphi adding {$R *.res} in the .dpr file

Delphi sometimes adds {$R *.res} in front of the unit path in the .dpr file uses clauses, then I get a duplicated resources warning when trying to compile. Anyone knows why the hell Delphi does that? I'm using Delphi 2009 but this happens since Delphi 2007 (maybe 2006 too) ...

What is a equivalent of Delphi FillChar in C#?

Hello, This is my first question so I would like to say hello to everyone. My friend was programming in Delphi. Now he is learning C# and asked me, if I know C# eqivalent of Delphi's FillChar. Could you please help me to help him? Kind regards ...

Where can I find a Text-to-Speech component for delphi?

I want to add text to speech user guided instruction to my applications. Where can I find a Text to speech component to do that. I do not want to use the Windows functions. ...

Is it safe to remove and reassign events this way? If not, why?

A.Event1 := nil; A.Event2 := nil; try ... finally A.Event1 := MyEvent1; A.Event2 := MyEvent2; end; Can something go wrong with it? EDIT: I've accepted Barry's answer because it answered exactly what I asked, but Vegar's answer is also correct depending on the scenario, sadly I can't accept both. ...

Why does every build change the exe-file?

Building the same project (without any changes) produces binary different exe-files: some small regions of them are different. Empty project, version information (and auto-increment on every build) is turned off. Why it happens? And is it possible to make delphi produce binary equal files for the same projects? ...

Doing XNA in Delphi Prism

I have installed Delphi Prism and XNA Game Studio 3.0. I have managed to translate to Delphi Prism XNA Tutorial 1 "Displaying a 3D Model on the Screen" (http://msdn.microsoft.com/en-us/library/bb197293.aspx). Project compiles fine, but I cannot load a model. It looks like there is a new "contentproj" type in XNA that is not in Delphi Pr...

How can I reserve memory for pointer to an array in Delphi?

Hi everybody. I'm developing class to represent special kind of matrix: type DifRecord = record Field: String; Number: Byte; Value: smallint; end; type TData = array of array of MainModule.DataRecord; type TDifference = array of DifRecord; type TFogelMatrix = class private M: Byte; N: Byte; Data: ^...

Is it possible to have multiple header rows in a virtual string tree?

I have a need for multiple fixed rows for the header of a virtual string view. Something that looks like the effect you get if you set a StringGrid's FixedRows property to a value greater than 1. Is there a way to achieve this? Some searching on the Soft-Gems website and forums led me to a couple of mentions of an AdvancedHeaderDraw meth...

Default implementations of Abstract methods

I am dealing with a large codebase that has a lot of classes and a lot of abstract methods on these classes. I am interested in peoples opinions about what I should do in the following situation. If I have a class Parent-A with an abstract method. There will only be 2 children. If Child-B implements AbstractMethodA but Child-B does ...

Delphi ADO connection to DBF files hangs when debugging

I'm connecting to DBF files using Delphi 2009 ADO components and this connection string: Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=c:\mypath; If c:\mypath doesn't exist, and I run the application inside the debugger, my app hangs. No exception is raised. If I run the application without debugging, an exception is prope...

Detect an internet connection activation with Delphi

I've been using a 3G wireless card for a while and every time I connect, my anti-virus fires up the updates. I'm wondering what is the Win32 API set of functions that I can use to, either, get notified or query about the event of an Internet Connection coming up? And is there already a set of ported headers for Delphi? ...

How can I execute a sql command with a blob param in dbx?

I have a TSqlDataSet which has a blob field, I need to get the data of this blob field in the BeforeUpdateRecord event of the provider and execute an update command, I've tried this: Cmd := TSQLQuery.Create(nil); try Cmd.SQLConnection := SQLConnection; Cmd.CommandText := 'UPDATE MYTABLE SET IMAGE = :PIMAGE WHERE ID = :PID'; Cmd.Pa...

Shall I use "virtual" keyword for destructor of base-class which is actually an interface?

I have an abstract base class and derived class: type TInterfaceMethod = class public destructor Destroy; virtual; abstract; procedure Calculate; virtual; abstract; procedure PrepareForWork; virtual; abstract; end; type ConcreteMethod = class(TInterfaceMethod) private matrix: TMinMatrix; public constructor Crea...

How do I declare a TDictionary enumerator?

I've got a TDictionary that stores a bunch of objects indexed by name, and I'd like to be able to examine all of the objects. So I tried this: var enumerator: TMyObject; begin for enumerator in myDictionary do But that wouldn't compile. "Incompatible types: 'TMyObject' and 'TPair' So I tried it a bit differently: var enumerator:...

THotkey with win-key support?

Hi all, Is there anyway to get the THotkey component in delphi to support the windows key? Or does anyone know of a component that can do this? Thanks heaps! ...

Can I overload operators for my own classes in Delphi?

I faced a little trouble - I do not know if I can define my own operators for my classes. For example: type TMinMatrix = class(TMatrix) private RowAmount: Byte; ColAmount: Byte; Data: DataMatrix; DemVector, SupVector: SupplyDemand; public constructor Create(Rows, Cols: Byte); function GetRow...