delphi-7

Moving controls between Delphi components

一笑奈何 提交于 2019-12-13 03:14:06
问题 I´m trying to create a Delphi non-visual component that can hold some visual components. In design time I create a custom TPanel, so I can put my visual components in it and then I try to get this controls from the TPanel and store them in another component. This is my custom panel TDesignTimePanel = class(TPanel) private FPanel: TPanelDialogo; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure GetChildren(Proc: TGetChildProc; Root: TComponent);

Using OgProtectExe from tponguard

和自甴很熟 提交于 2019-12-13 02:46:54
问题 Can anyone show me a simple example how this component is used.Thanks 回答1: In your application (the one you want to protect by embedding a CRC), drop an OgProtectExe component. Use the Object Inspector to add a handler for it's single event ( OnChecked , if I remember correctly). The handler should contain something like this: procedure TForm1.OgProtectExe1Checked(Sender: TObject; Status: TExeStatus); begin if (Status <> exeSuccess) then // CRC changed // Handle modified executable end;

Delphi tbsSeparator TToolButton on a non-themed TToolBar with Flat style has a vertical line in the middle - how to fix it?

别来无恙 提交于 2019-12-13 01:21:46
问题 My question is related to this one: Can Delphi themed toolbars have dividers that are centred between their tool buttons? I have a Delphi 7 application where I have a TToolButton with Style = tbsSeparator on a TToolBar with Flat = True . Using the fix accepted in the question mentioned above, a tbsSeparator and a tbsDivider are drawn as expected if the toolbar is themed (i.e. if my application has a theme manifest ( XPMan ) and Windows themes is enabled on the system the application is

“List index out of bounds” on TListBox

眉间皱痕 提交于 2019-12-13 00:38:03
问题 I have a TListBox on a form, and items are added with listbox1.ItemIndex := listbox1.Items.AddObject('msg', TObject(grp)); grp is an integer. The listbox is set to lbOwnerDrawFixed . In the onDrawItem event I get the exception EStringListError raised on the marked line: msg := (control as Tlistbox).Items.Strings[index]; // this line works grp := integer((control as Tlistbox).Items.Objects[index]); // exception here msg and grp are local string and integer variables. Project ### raised

Why is Assignable typed constants disabled in my Delphi 7 by default?

流过昼夜 提交于 2019-12-13 00:28:00
问题 Instead of me being able to just type const clicks : Integer = 1; I have to type {$J+} const clicks : Integer = 1; {$J-} I think its alot easier to just checked the box in the compiler options menu.. but i wanted to make sure that it wouldnt hurt me in the long wrong.. and was wondering why it would be disabled (Un-checked)? I appreciate any help on this, thank you guys. 回答1: The default has been to disable them since Delphi 2 was released, IIRC. The actual option was provided in the dialog

How to eliminate variables “panel1, panel2, panel3 .. etc.” in Delphi?

纵饮孤独 提交于 2019-12-12 21:54:17
问题 i have this type type TMain = class(TForm) panel1: Tpanel; panel2: Tpanel; panel3: Tpanel; panel4: Tpanel; panel5: Tpanel; panel6: Tpanel; panel7: Tpanel; panel8: Tpanel; ...... panel45: Tpanel; label1: TLabel; label2: TLabel; label3: TLabel; label4: TLabel; label5: TLabel; label6: TLabel; label7: TLabel; ........... label109: TLabel; How can i call this components in one line... inside the Type? Thank you ... UpDate.... Base from the anwser i get and accepted it works great when i have all

How to check if OleInitialize has already been called?

試著忘記壹切 提交于 2019-12-12 16:16:00
问题 I want to write a Delphi function to register a dll. I want the function to check if OleInitialize has already been called before it does so. I guess I'm trying to avoid the consequences of initializing twice because I'm not sure what they might be. I'm worried that my function won't handle as wide a variety of dlls as regsvr32.exe. 回答1: Take a look at the documentation: Return Value [...] S_FALSE - The COM library is already initialized on this apartment. ... and also: Typically, the COM

Delphi 7, DUnit and FastMM reporting Strings incorrectly

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 14:48:59
问题 I'm using DUnit and FastMM to catch unfinalized memory blocks but there seems to be a Bug. I dunno if its in FastMM, DUnit or in Delphi itself, but here goes: When my Test Case has internal strings, the test fails with memory leaks. If I run the same test again without closing the DUnit GUI, the test passes OK. The same occours with DUnit GUI Testing, I believe for the same reason. There are no Leaks in my app, the proof is that FastMM doesn't generate the leak report in those cases. Question

dbExpress/No key specified

帅比萌擦擦* 提交于 2019-12-12 10:47:10
问题 I am working on a database program, using the dbExpress components (Delphi 7). The data is retrieved from the database via the following components: TSQLDataSet -> TDataSetProvider -> TClientDataSet -> TDatasource -> TDBEdit. Until now, the form has worked correctly. The query in the TSQLDataset is select id, name, byteken, timeflag from scales where id = :p1 I added a large (2048) varchar field to the database table; when I add this field to the above query (and connect either a TDBMemo or a

Make already developed application 64 bit enable [duplicate]

一世执手 提交于 2019-12-12 10:43:55
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: How to also prepare for 64-bits when migrating to Delphi 2010 and Unicode I have already developed an application in Delphi 7. Now I need to enable it to support 64 bit. 回答1: Delphi 7, and indeed all released Delphi Win32 versions, only produce 32 bit executables. However, 32 bit executables run perfectly well on 64 bit operating systems through the WOW64 emulator. Although this is an emulator, a word that