Delphi

Search thru a memo in Delphi?

冷暖自知 提交于 2020-01-13 09:35:10
问题 Can anybody give me some simple code that would give me the ability to search a simple string in a memo and have it highlighted in the memo after being found? 回答1: This search allows for document wrap, case (in)sensitive search and searching from cursor position. type TSearchOption = (soIgnoreCase, soFromStart, soWrap); TSearchOptions = set of TSearchOption; function SearchText( Control: TCustomEdit; Search: string; SearchOptions: TSearchOptions): Boolean; var Text: string; Index: Integer;

It seems that sometimes Delphi is case-sensitive - “override method should match case of ancestor”

主宰稳场 提交于 2020-01-13 08:52:27
问题 Today I've encountered a 'strange' hint: override method xxxx should match case of ancestor yyyy. Solution was to declare the method name exactly as in the ancestor....I believe this is something which rested in the compiler since the Delphi.Net compiler... Declaring the method exactly as in the ancestor made the compiler 'silent'. There are other 'case-sensitive' hints/warnings in Delphi 2006 and up? 回答1: It's a hint that's in place to protect your code when cooperating with 3rd party code.

It seems that sometimes Delphi is case-sensitive - “override method should match case of ancestor”

给你一囗甜甜゛ 提交于 2020-01-13 08:52:08
问题 Today I've encountered a 'strange' hint: override method xxxx should match case of ancestor yyyy. Solution was to declare the method name exactly as in the ancestor....I believe this is something which rested in the compiler since the Delphi.Net compiler... Declaring the method exactly as in the ancestor made the compiler 'silent'. There are other 'case-sensitive' hints/warnings in Delphi 2006 and up? 回答1: It's a hint that's in place to protect your code when cooperating with 3rd party code.

64bit Memory allocation

↘锁芯ラ 提交于 2020-01-13 08:43:07
问题 I've been asked to create a Delphi compatible dll in C++ to do simple 64bit memory management. The background is that the system in Delphi needs to allocate a lots of chunks of memory that would go well outside 32bit addressable space. The Delphi developer explained to me that he could not allocate memory with the Delphi commands available to him. He says that he can hold a 64bit address, so he just wants to call a function I provide to allocate the memory and return a 64bit pointer to him.

I want to assign a record to TStringList.Objects

[亡魂溺海] 提交于 2020-01-13 08:41:52
问题 I want create a Playlist control. I have a lot of information to display into a TStringList. I want to assign a record to TStringGrid.Objects instead of an object because so many objects may take a while to create/destroy. It also take a lot of RAM. A record will be much faster and slim. How can I do that? TYPE AMyRec= packed record FullName : string[255]; RelativePath : boolean; IsInvalid : boolean; InCache : boolean; etc end; 回答1: You can use a TList to a Pointer of your record. Eg: Type

Getting output from a command-line program in a Delphi application on Windows XP

笑着哭i 提交于 2020-01-13 07:29:10
问题 I have VCL application written in Delphi XE2 that needs to execute a command-line program (also written in Delphi XE2) and obtain the text output by it. I am currently using the following code, which is based on that found here: Getting output from a shell/dos app into a Delphi app function GetDosOutput(ACommandLine : string; AWorkingDirectory : string): string; var SecurityAttributes : TSecurityAttributes; StartupInfo : TStartupInfo; ProcessInformation: TProcessInformation; StdOutPipeRead,

How do I send and handle message between TService parent thread and child thread?

我的梦境 提交于 2020-01-13 06:47:10
问题 I am using Delphi 2010 to create a Windows service that will monitor several registry keys, and perform an action when a change occurs. I am using RegMonitorThread from delphi.about.com, and my issue is that my main service thread never receives the message that is sent from the TRegMonitorThread. type TMyService = class(TService) procedure ServiceExecute(Sender: TService); procedure ServiceShutdown(Sender: TService); procedure ServiceStart(Sender: TService; var Started: Boolean); private

How to animate a spinner while performing a workload via threading

一笑奈何 提交于 2020-01-13 06:37:07
问题 I am having troubles using multiple threads in my Delphi xe5 application for an iOS device. My goal is to perform 'some work' (SQL query), while having a TAniIndicator is spinning. I have tried using Applicaiton.ProcessMessages(), but that doesn't keep the spinner loading smoothly, if spinning at all sometimes. Here is my current code for a btn.OnClick begin if btnLogin.Text = 'Login' then begin aThread := TMyThread.Create(True); aThread.FreeOnTerminate := true; aThread.Start; while Mode1 = 0

DELPHI 文件类型种类

我的梦境 提交于 2020-01-13 06:24:47
1. 工程文件( Delphi Project File ) 工程文件是一个特殊的单元文件,是应用程序的主程序,它管理应用程序中的其他文件,该文件的拓展名是 *.dpr ,是一个文本文件 2. 窗体文件( Delphi Form ) 窗体文件存储有关窗体中对象的信息,它是一个二进制文件,窗体文件的拓展名为 *.dfm ,每个窗体文件都有一个与之相对应的单元文件,如有一个名为 Unit1.dfm 的窗体文件,就有一个名为 Unit1.pas 的单元文件与之对应。 Unin2 3. 单元文件( Pascal File ) 用于存储与程序功能有关的常量、变量、数据类型、函数与过程的定义,单元文件的拓展名为 *.pas ,是一个文本文件 4. 资源文件( Resource File ) 该文件由 Delphi 在创建应用程序时自动建立,用于存放与应用程序有关的主题( Title )、应用程序图标和版本信息。资源文件的基本文件名与应用程序的工程名相同,拓展名为 *.Res ,是一个二进制文件。 5. 工程选项文件( Delphi Options File ) 该文件由 Delphi 在创建应用程序时自动建立,用于存放与应用程序有关的工程选项等信息。工程选项文件的基本文件名与应用程序的工程名相同,扩展名为 *.dof ,是一个文本文件。 6. 编译命令配置文件 该文件由 Delphi

Delphi 6 command line compile: NO DCU’s

回眸只為那壹抹淺笑 提交于 2020-01-13 06:12:41
问题 When using dcc32 against the .dpr file it produces a dll but no dcu’s. The project level .cfg is using the –N switch to set the path but nothing is in the directory specified. It must see the .cfg as the –E switch is working. I tried to use brcc32/brc32 against the .dpr file before a call dcc32 but either one gives me the Error projectName.dpr 3 1: Expecting END? I need the dcu’s from project1 for project2 which when I run the dcc32 against the .dpr it errors stating it can’t find the missing