delphi-7

Is it possible to get the size of the type that a pointer points to in Delphi 7?

不打扰是莪最后的温柔 提交于 2019-12-24 07:43:04
问题 I want to get the size of any "record" type in following function. But seems it doesn't work: function GetDataSize(P : Pointer) : Integer; begin Result := SizeOf(P^); // **How to write the code?** end; For example, the size of following record is 8 bytes SampleRecord = record Age1 : Integer; Age2 : Integer; end; But GetDataSize(@a) always returns 1 (a is a variable of SampleRecord type of course). What should I do? I noticed that Delphi has a procedure procedure New(var P: Pointer) which can

delphi Creating Component template

跟風遠走 提交于 2019-12-24 07:31:14
问题 I am working with Delphi application.I created one form shown as below: I wanted to make component out of this controls through code . But not through component-->create component Template -->so on. How do i make component template out of form contols through delphi code .?? Thanx in advance. 回答1: Or if you want to have that group of controls as one single component you can install unit like this into some package: unit EditGroup; interface uses SysUtils, Classes, Graphics, Controls, StdCtrls

How do I get access to FastMM4's RegisterExpectedMemoryLeak?

泪湿孤枕 提交于 2019-12-24 04:28:07
问题 I'm using Delphi's fastMM memory manager and I fail when I try to use the full debug mode. I get the following errors when compiling: FastMM\FastMM4.pas(6872) Error: Undeclared identifier: 'RegisterExpectedMemoryLeak' FastMM\FastMM4.pas(6948) Error: Undeclared identifier: 'UnregisterExpectedMemoryLeak' FastMM\FastMM4.pas(9269) import_test.dpr(24) Fatal: Could not compile used unit 'FastMM\FastMM4.pas' The .inc file tells to load the full debug dll. I've already copied the FastMM_FullDebugMode

The best solution to process the huge text file data in Delphi 7

青春壹個敷衍的年華 提交于 2019-12-24 03:48:37
问题 I have text file like this: "01","AAA","AAAAA" "02","BBB","BBBBB","BBBBBBBB" "03","CCC" "04","DDD","DDDDD" I want to load this text file data into temp table in sybase db. So, I need to build a program to read line by line this text file until eof. If the text file size is small, the process to read line by line is fast. But if text file size is too big (can be more than 500M), the process read line by line is too slow. I think the read line by line method not suitable for huge text file. So,

How can I create my own custom Hint for a specific control?

[亡魂溺海] 提交于 2019-12-24 03:17:39
问题 I need to create a custom hint window (with it's own color and layout) for a specific control (not the entire application) The hint text itself will not be connected to that specific Hint property control. As suggested I wrote a handler for CM_HINTSHOW (This worked if the Control has ShowHint=True ): procedure TMyControl.CMHintShow(var Message: TMessage); begin Form1.caption := 'x'; // Here I will display my own Hint window // inherited; end; But now, how do I know when/where to hide it when

Making Delphi 7 play nice with source control? [closed]

邮差的信 提交于 2019-12-24 00:46:59
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . Hello I've been having to work in a Delphi 7 project recently and one thing that constantly bugs me is the *.dfm files. Anytime I even

Making Delphi 7 play nice with source control? [closed]

假如想象 提交于 2019-12-24 00:41:06
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . Hello I've been having to work in a Delphi 7 project recently and one thing that constantly bugs me is the *.dfm files. Anytime I even

Collect all active window class names

安稳与你 提交于 2019-12-23 18:37:44
问题 Many programs (True Transparancy and others) can get all active or running in background window class names like this one: Delphi 7 Object Inspector name is tpropertyinspector Opera main window class name is operawindowclass etc. So how to get any opened window class name in Delphi? 回答1: Call EnumWindows to get all the top level windows. Then call GetClassName to find out the window class name for each window. If you also wish to probe child windows then call EnumChildWindows on each top

How to draw a Number to an Image Delphi 7

人走茶凉 提交于 2019-12-23 17:37:07
问题 I have a requirement to draw a number to a image .That number will changes automatically.how can we create an image dynamically in Delphi 7 ? .If any one knows please suggest me. Yours Rakesh. 回答1: You can use the Canvas property of a TBitmap to draw a text in a image check this procedure procedure GenerateImageFromNumber(ANumber:Integer;Const FileName:string); Var Bmp : TBitmap; begin Bmp:=TBitmap.Create; try Bmp.PixelFormat:=pf24bit; Bmp.Canvas.Font.Name :='Arial';// set the font to use Bmp

TypeCasting : what is difference between below 2 lines of code?

社会主义新天地 提交于 2019-12-23 17:27:08
问题 what is the difference between below 2 lines of code. Both are trying to get the path and one is working and other is throwing error. i am working on Delphi-7 Path:= (((FFormOwner as TForm).Designer) as IDesigner).GetPrivateDirectory; --Working Path:= IDesigner(TForm(FFormOwner).Designer).GetPrivateDirectory ; --Error Below is the code which is using line of code to get the path. constructor TsampleComponent.Create(AOwner: TComponent); begin inherited Create(AOwner); FFormOwner:=TForm(Owner);