delphi-7

Delphi 7: Handling events in console application (TidIRC)

喜你入骨 提交于 2019-12-29 08:16:09
问题 I'm trying to make a console application based on Indy's IRC Component (TIdIRC) but I'm having trouble with events. Here's my code: program Project1; {$APPTYPE CONSOLE} uses SysUtils, Classes, Math, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdIRC; type TEvents = class public procedure Raw(Sender: TObject; AUser: TIdIRCUser; ACommand, AContent: String; var Suppress: Boolean); end; const IrcServ = 'gr.irc.gr'; IrcPort = 6667; IrcChan = '#lalala'; var Irc: TidIRC; Event:

How to use Animated Gif in a delphi form

怎甘沉沦 提交于 2019-12-27 22:13:28
问题 I think theres no native support to gif animated images. How is the best way? any free component that allow that? I was thinking in using a TImage and a ImageList + Timer, but I need to export each frame of the gif to a separated bmp file. 回答1: It's pretty simple in modern Delphi. It's all built in. Drop a TImage onto the form and load the animated GIF into the Picture property. Then, start the animation by means of the Animate property: (Image1.Picture.Graphic as TGIFImage).Animate := True;

Can Windows manage multiple focus points on a single control?

北城以北 提交于 2019-12-25 05:36:13
问题 I'm building a custom control which is to have multiple focus points. For example, within 1 control, let's say there's 3 regions (could be defined as a rect on the canvas) which are to be able to have focus. Depending on which one has focus, I don't want the default Windows dotted line around it, but some special handling. I know nothing about how to even give 1 custom control its own focus. The original project was a single TPanel with a few VCL controls on it, each of course being its own

delphi 7, FastMM4 cannot install work around

独自空忆成欢 提交于 2019-12-25 05:16:21
问题 i am working on an application that uses FastMM4 , from sourceforge.net. So i have added the FastMM4.pas to the uses clause right at the beginning. In the application i need to run a batch file after FinalizeMemoryManager; in the finalization of unit FastMM4; like this initialization RunInitializationCode; finalization {$ifndef PatchBCBTerminate} FinalizeMemoryManager; RunTheBatFileAtTheEnd; //my code here..calling a procedure {$endif} end. then my code for RunTheBatFileAtTheEnd is :

Incorrect Result of Total Download's Code

孤人 提交于 2019-12-25 04:34:34
问题 I use the following code to display the total download and upload. The problem arises when the cumulative download exceeds 2 GB, the result being the number of bits: var Form1: TForm1; Downloaded, Uploaded:integer; implementation {$R *.dfm} procedure TForm1.Timer1Timer(Sender: TObject); begin if Downloaded < 1024 then Recv.Caption := FormatFloat(' + Recv: #,0 Bit',Downloaded) else if (Downloaded > 1024) and (Downloaded < 1048576) then Recv.Caption := FormatFloat(' + Recv: #,##0.00 Kb'

How to add List view item into dataset in delphi?

北战南征 提交于 2019-12-25 03:14:14
问题 i am developing invoicing system in my application there is a listview, a fastreport, button.. when press the the button the report should show the all item in the report can anyone provide best solution for this? 回答1: From example PrintStringList from FastReport's Demos folder: var Button1: TButton; StringDS: TfrxUserDataSet; frxReport1: TfrxReport; StringList: TStringList; procedure TForm1.Button1Click(Sender: TObject); begin StringDS.RangeEnd := reCount; StringDS.RangeEndCount :=

TPanel color is black when I drop a XPManifest control on my form

一世执手 提交于 2019-12-24 12:12:28
问题 This is a continuation of a previous post: TPanel color is black no matter what The problem is this: All TPanels that have a TForm as parent, turn black when I use a XPManifest. Anybody knows why? 回答1: Change Panel1.ParentBackground to true then change it back to false . 回答2: There is no other solution for this than deleting the XPManifest. 来源: https://stackoverflow.com/questions/3233568/tpanel-color-is-black-when-i-drop-a-xpmanifest-control-on-my-form

Invalid Pointer Operation + Runtime Error with custom drawing

你。 提交于 2019-12-24 10:37:43
问题 I'm working on a simple little app which has 1 image and 3 timers. The goal is to draw a number of balls chasing back and forth with a decaying color after each one. It looks something like this: Now the problem is when I close the application, I get a number of errors in this order, and does not give me a breakpoint in the code. It only happens when it's moving from the right to the left, not from the left to the right. I thought it probably had to do with the timer(s) continuing after the

please give me the difference in using export and stdcall keywords for exporting the functions in Dll using delphi7

久未见 提交于 2019-12-24 09:18:56
问题 uses SysUtils, Classes; {$R *.res} function add(Value1:integer;value2:integer):integer;stdcall; begin Result:=Value1+value2; end; function subtract(Value1:integer;value2:integer):integer;stdcall; begin Result:=Value2-value1; end; function multiply(Value1:integer;value2:integer):integer;stdcall; begin Result:=Value1*value2; end; function divide(Value1:integer;value2:integer):integer;stdcall; begin Result:=Value2 div value1; end; function check(Value1:integer;value2:integer):Boolean;stdcall;

Landscaping in Rave Reports using Delphi 7

筅森魡賤 提交于 2019-12-24 07:58:45
问题 I have an application that uses Rave Reports on Delphi 7. I want the reports to have its default display in landscape. How am I going to do it? Any suggestions would be very much appreciated. 回答1: Just drop TRvSystem component and set SystemPrinter.Orientation to poLandScape. exemple: RvSystem1.SystemPrinter.Orientation := poLandScape; 来源: https://stackoverflow.com/questions/1665000/landscaping-in-rave-reports-using-delphi-7