delphi

What is the compiler directive to generate a detailed map file.

I wish to know is there a compiler directive which I can use in my code (not from the UI) to set that the compiler/linker should generate a detailed map file. Is there something like: {$MAPFILE DETAILED}? I am using Delphi 2009. ...

TPersistent + interface, Delphi

Hi, I need a class that is based on TPersistent (so it stores the RTTI) and includes default Interfaces handling (QueryInterface, _AddRef, _Release) ... what is the class name I'm looking for? ...

How does one support custom Desktop DPI settings in Delphi 7 applications?

We have a few legacy applications that were written in Delphi 7. We've had a few requests over the years to support custom desktop dpi settings in these applications but we have been able to dodge the bullet up till know. Well we can't anymore. When users set their desktops to say 120dpi some of the controls "fall off" the application o...

How do I change the width of a ScrollBar?

I would like to change a TFrame's ScrollingBar width. I know I could change all ScrollingBars in the system by: SystemParametersInfo(SPI_SETNONCLIENTMETRICS,.... But how do I do it for a specific WinControl? ...

What needs finalization in a multidimensional dynamic array?

I use dynamic arrays a great deal and have no problems with the SetLength and Finalize procedures. I recently had cause to use dynamic arrays where each array element could itself contain a variable number of elements. The declaration is like this: TScheduleArray = array of array of array [1..DaysPerWeek] of TShiftType; The software...

How to send an "ENTER" key press to another application?

I have code that launches an external application and automatically fills in a password prompt. I want to automate the pressing of the "ENTER" key, so that the user does not have to click "OK". How can I send the ENTER key to an external application? Below is my code as it stands right now. The first line to post the password to the ...

getwindowtext not retrieving text

I tried the following code but it does not retrieve text from foreground window! procedure TForm1.Button1Click(Sender: TObject); var title : pansichar; s : string; begin GetWindowText(GetForegroundWindow(), title,GetWindowTextLength(GetForegroundWindow()) + 1); s := title; showmessage(s); end; ...

Writing a string to a TFileStream in Delphi 2010

I have Delphi 2007 code that looks like this: procedure WriteString(Stream: TFileStream; var SourceBuffer: PChar; s: string); begin StrPCopy(SourceBuffer,s); Stream.Write(SourceBuffer[0], StrLen(SourceBuffer)); end; I call it like this: var SourceBuffer : PChar; MyFile: TFileStream; .... SourceBuffer := StrAlloc(1024); MyFi...

Calling .NET assembly using Xslt from Delphi 5 Win32 assembly.

This is my first attempt to call a .NET assembly from a Delphi 5 (Win32) native assembly. I am only familiar with C# and .NET so please bear with me. I guess I will walk thru this layer by layer. Here is the code for the C# assembly I am attempting to execute from the Delphi 5 assembly. using System; using System.Collections.Generic; us...

[Delphi] If everything implemented an interface, would this be garbage collection?

I'm still something of a newbie, and I know my thinking is incorrect; I just don't know where ... Just about everything in Delphi is descended from TObject. What if everything instead descended from a TInterfaceObject that implemented some trivial interface (e.g., "INamable," with a single method that returned a class's name string)? S...

How can I tell if I'm running on x64?

I just got a bug report for an issue that only occurs when the program is running "on a 64-bit machine." Now, Delphi doesn't produce 64-bit code, so theoretically that shouldn't matter, but apparently it does in this case. I think I have a workaround, but it will break things on 32-bit Windows, so I need some way to tell: If I'm runn...

Delphi7, passing object's interface - causes Invalid Pointer Operation when freeing the object.

I have a class that implements an interface, which is made available for plugins. The declaration of class is quite simple. There is only one instance of this class for an entire application. When the function that returns the interface is called, it calls _AddRef on the retrieved interface before passing it back as result. Unfortunately...

How can I embed complex types into wsdl definition?

Hi, WCF generates complex types as external xsd files. How can I embed these definitions into wsdl? Because Delphi WSDL importer cannot import the complex types in the xsd files. Thank you. ...

free the variant VarArray

FUNCTION SystemspartsClT.KeyFound(Key : AluCostDict.SystemspartskeyT) : BOOLEAN; VAR v : Variant; BEGIN v := VarArrayCreate([0,1], VarInteger); v[0] := Key.System; v[1] := Key.PartType; Sucess := t.Locate('System;PartType', v, []); v := NULL; Result := Sucess; END; I am using Delphi for Win32. Does thi...

Insert a combo box in a list view cell with Delphi 5

Hi, I'd like to put a TComboBox in a TListView component. Any idea how I could do that ? I don't have a clue, I'm not a delphi guru x_x. Also, I can't use external components. Any help is welcome :) ...

In Delphi is there a function to convert XML date and time to TDateTime

XML date and time are in the format '-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)? were •'-'? yyyy is a four-or-more digit optionally negative-signed numeral that represents the year; if more than four digits, leading zeros are prohibited, and '0000' is prohibited •the remaining '-'s are separators between parts o...

Faster DirectoryExists function?

Hi, I use DirectoryExists (const PathName : String); to check if a directory is reachable from a computer or not. But if the directory does not exist and the path name is a network path, i.e. \\computer1\Data the method takes a very long time to return. There must be a faster way to determine that a network folder is not reachabl...

How to display rich text in a TDBGrid?

I have a table with a RTF field in it. How can I display this in a TDBGrid so that it actually shows the rich text, and not just (FMTMEMO) in the column? I really don't want to use a third party component for this. Thanks! ...

[Delphi] Remove Item from ListBox?

Hello, Is there any way to remove item from listbox based on it's name but not index value? I would like to remove item named "Mouse" (which index # changes all the time). ...

postthreadmessage and peekmessage problem in delphi 2006

I created a multichilded application. The application windows (W[n]: TMyWindows) are all the same and all have an private object class instance associated with them (E: TMyObject). The child windows generate through this objects some messages. I have created in the main application two threads which process these messages depending on th...