delphi-2009

Constant breakpoints? How to remove them?

白昼怎懂夜的黑 提交于 2019-12-04 01:58:35
I downloaded a project made with Delphi 2009,which is also what I use,however there is one breakpoint that I just can't remove.If I try to remove it,its being executed again after the program is executed. I met such things in other debuggers known as Hardware breakpoints,but this is not important.How do I remove the breakpoint? EDIT: Article about those breakpoints,but It doesn't explain how to remove them. If, for whatever reason, you can't turn these off in the IDE, as Rob says, this is persisted in the .dsk file. You don't have to delete the file (and all of your other settings), though.

Delphi TThread.CurrentThread and EAccessViolation - Is This a Bug or My Incompetence..?

耗尽温柔 提交于 2019-12-04 01:40:22
In Delphi 2009 I'm finding that any time I use TThread.CurrentThread in an application, I'll get an error message like the following when the application closes: Exception EAccessViolation in module ntdll.dll at 0003DBBA. Access violation at address 7799DBBA in module 'ntdll.dll'. Write of address 00000014. Unless it's just my machine, you can replicate this in a few seconds: create a new Delphi Forms Application, add a button to the form, and use something like the following for the button's event handler: procedure TForm1.Button1Click(Sender: TObject); begin TThread.CurrentThread; end; On

3 points are collinear in 2d

☆樱花仙子☆ 提交于 2019-12-04 01:15:15
问题 I am trying to verify when 3 points (double) are collinear in 2-D. I have found different Pascal functions that return true if this is verified; those functions use integer to specify X and Y coordinates. I need a more precise calculation at least to the first 3 digits of the decimal part of X and Y expressed as double type. Who can help me with this? I found this function: function Collinear(x1, y1, x2, y2, x3, y3: Double): Boolean; begin Result := (((x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 -

Where do I define symbols tested with {$IFDEF}?

末鹿安然 提交于 2019-12-04 00:26:52
When I use Delphi directives in code, like: {$IFDEF something} . . . {$ENDIF} Where do I assign the word 'something' in the project? I tried in some places in project options but it didn't work. Guess I didn't find the correct one. It's in the Conditional Defines slot under Project | Options, which looks like this on D2010: Other answers have pointed you at the places to define symbols and the scope implications of the different approaches. However, what no-one has yet mentioned is that if you change the DEFINE symbols you MUST do a FULL BUILD of your project for them to have any effect on

Logging and Synchronization

混江龙づ霸主 提交于 2019-12-03 20:24:47
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 the Items member of a listbox can be used as the target. type ILogger = Interface (IInterface) procedure Log (const LogString : String; LogLevel : TLogLevel); procedure SetLoggingLevel (LogLevel : TLogLevel); end; type TGUILogger = class (TInterfacedObject,

How to show backslash in a japanese locale

只谈情不闲聊 提交于 2019-12-03 18:26:15
In my application I have used a backslash as part of a text-based activity indicator (a typical /-\ sequence.. I removed the | because it had a different width). All was well until I saw my application being run on a japanese computer. The backslash was replaced with a japanese character. How can I avoid this? In your delphi application you can select a Font that renders that Unicode codepoint as a backslash. However, most standard fonts including many in Windows, will intentionally show a Yen mark instead of a backslash, in Japanese locales, for reason that users expect it. If you want to be

How to create a file shortcut (*.lnk file) on desktop in Windows?

假装没事ソ 提交于 2019-12-03 17:20:16
问题 function GetDesktopFolder: string; var buf: array[0..MAX_PATH] of Char; pidList: PItemIDList; begin Result := StrNoDesktopFolderFo; SHGetSpecialFolderLocation(Application.Handle, CSIDL_DESKTOP, pidList); if (pidList <> nil) then if (SHGetPathFromIDList(pidList, buf)) then Result := buf; end; procedure p; var i: Integer; IObject: IUnknown; ISLink: IShellLink; IPFile: IPersistFile; PIDL: PItemIDList; InFolder: array[0..MAX_PATH] of Char; TargetName: string; LinkName: string; begin TargetName :=

Pointer to generic type

泪湿孤枕 提交于 2019-12-03 16:12:35
In the process of transforming a given efficient pointer-based hash map implementation into a generic hash map implementation, I stumbled across the following problem: I have a class representing a hash node (the hash map implementation uses a binary tree) THashNode <KEY_TYPE, VALUE_TYPE> = class public Key : KEY_TYPE; Value : VALUE_TYPE; Left : THashNode <KEY_TYPE, VALUE_TYPE>; Right : THashNode <KEY_TYPE, VALUE_TYPE>; end; In addition to that there is a function that should return a pointer to a hash node. I wanted to write PHashNode = ^THashNode <KEY_TYPE, VALUE_TYPE> but that doesn't

Where Is TShellListView in Delphi 2009?

社会主义新天地 提交于 2019-12-03 15:52:40
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? Answer here It looks like this package is not installed by default. Navigate to Delphi demos (they are in "c:\Users\Public\Documents\RAD Studio\6.0\Demos" on my machine; you should replace 6.0 with the appropriate version if you're not running Delphi 2009) and open subfolder DelphiWin32\VCLWin32\ShellControls.

Howto cast pointer to generic parameter type?

感情迁移 提交于 2019-12-03 15:43:35
it's my first question here, glad to have found this site. My question deals with the new Generics feature in Delphi 2009. Basically I tried to write a generic wrapper class for an existing hash map implementation. The existing implementation stores (String, Pointer) pairs, so in the wrapper class I have to cast between the generic parameter type T and the Pointer type and vice versa. type THashMap <T : class> = class private FHashList : THashList; ... end; I thought of a cast like this (Value : T) Value := (TObject (Ptr)) as T But this doesn't work. The compiler tells me 'Operator not