delphi

How do do things during Delphi form startup

I have a form one which I want to show a file open dialog box before the full form opens. I already found that I can't do UI related stuff in FormShow, but it seems that I can in FormActivate (which I protect from being called a second time...) However, if the user cancels out of the file open dialog, I want to close the form without p...

Delphi Parent Form Buttons

Is there a way to disable the parent windows buttons? I have a "working" form that is called by a lot of forms, that I would like to disable the parent form buttons until it's finished doing it's thing. Then turn them back on. I'd like to do something that is attached to the OnShow event and onClose event. Thanks -Brad ...

To show bitmap created in memory in Rave.

I have created a bitmap in memory, and would like to show this in rave report design time. I don't want to create a file then load. Is there a better way? Thanks and regards, jai ...

move project into dll

hi all i moved my project into a DLL and in there I declared a procedure like this procedure StartApp; var myForm : TmyForm; begin myForm:=TmyForm.Create(Application); myForm.Show; end; exports StartApp; my main application's contains a dpr file containing: procedure StartAPP; external 'myDLL.dll'; begin StartAPP; end;...

'working, please wait' screen with thread?

Dear Programmers, Perhaps, it is very easy for you, but I am hard working on a project (for educational purposes) that is querying adsi with TADSISearch component, for several days. I'm trying to show a 'Working, Please wait..' splash screen with a man worker animated gif on Form2 while TADSISearch is searching the Active Directory. Alt...

All array possibilities

I have pascal code (programming language actually doesn't mean anything): box[1] := 14; box[2] := 2; box[3] := 4; box[4] := 5; box[5] := 6; box[6] := 8; I want to get all possibilities. For instance, box[1] = box[6], then box[6] = box[1]. Yes, I can write it by my hand, but I guess I can make it more clever, by loop. Any ...

Delphi Sorting TListView Question

I'm using the code from: http://www.swissdelphicenter.ch/torry/showcode.php?id=1103 to sort my TListView, which works GREAT on everything but numbers with decimals. So I tried to do this myself, and I created a new Custom Sort called: cssFloat Created a new function function CompareFloat(AInt1, AInt2: extended): Integer; begin ...

Copying files which the main thread adds to a stringlist using a thread

I have a web creation program which, when building a site, creates hundreds of files. When the internet root folder is situated on the local pc, the program runs fine. If the internet root folder is situated on a network drive, the copying of a created page takes longer than creating the page itself (the creation of the page is fairly ...

Is there a stringgrid in objective-c cocoa framework as there is in Delphi

Is there a StringGrid in the Cocoa Framework or has anybody implemented one that would be like the one in Delphi? ...

FtpOpenFile returns nil instead of file handle when uploading

Hi, I'm transferring a file using ftp in Delphi. I am able to connect to the ftp account ok but when I try and upload a file the FtpOpenFile function returns nil instead of a handle the file to be uploaded. hintfile := FtpOpenFile(hintconnect,PChar(tgtfn),GENERIC_WRITE,FTP_TRANSFER_TYPE_BINARY,0); If I log into the ftp site using a...

Why does this code for checking proxy validity crash?

I have the following code in my program. When I try to check if the proxy is a valid proxy or not it crashes my program. Any ideas how to fix this? I'm using indy 10. if checkproxy('http://www.google.com') label1.text:='Good' else label1.text:='bad'; If I try to call another idHTTP connect after requesting checkproxy it crashes the...

Delphi - undeclared identifier: LOCALE_SYSTEM_DEFAULT

Hi all, I'm trying to format a float (extended) by the system locale's default currency settings. I have found the key proponent to this solution to be the following line: GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, format_settings); and everywhere I look, they provide the solution exactly as shown (no class specifier before, li...

EProgrammerNotFound exception in Delphi?

In Delphi 2009, SysUtils.pas contains this in line 425: EProgrammerNotFound = class(Exception); Is this simply an easter egg or something serious? When should this exception be raised? Does it also exist in Delphi Prism and/or Free Pascal? Conclusion (after reading the answers so far): This exception might appear in fun source c...

Windows thumbnail/frame view

What would be the easiest way to make a thumbnail view, where you have a panel with a vertical scroll bar, and a matrix of images describing their associated image? I'd also like it such that if the parent frame resized horizontally, the matrix would shrink to as many columns as necessary to display the thumbnails without a horizontal sc...

Which event is fired before current record changes in ADOQuery and how NOT to change the current record?

In my application, there are these data components linked like so: DBGrid > (DataSource > ADOQuery > ADOConnection) DBNavigator > (DataSource > ADOQuery > ADOConnection) Whenever the user selects a different row from the DBGrid, or uses the DBNavigator, the ADOQuery's current record changes. Fine, but when the user makes some changes ...

Add a property on TWinControl Class

I want to add a published property into TWinControl. Is there someway to do this without the necessity of recompiling the base source code ? If not, some way to recompile the base source code without too much troubles ? Tks in advice... EDIT 'CAUSE OF NEW IDEAS Alright, What I'm thinking to do I'm trying to override the _GetMem from...

Set the name of a thread created with SetTimer() API

I create a Windows timer using the following FHandle := SetTimer(0, 0, 1000, TFNTimerProc(@TMyClass.MyMethod)); Is this thread shown in the Delphi "Threads" window. If Yes how I can get this Thread ID? ...

Delphi pre-build event not executing BEFORE compile

I'm busy automating our builds to include the svn revision number. We're using Delphi 2010. I added a pre-build event calling a batch file that injects the the svn revision number (read from the entries file in the .svn directory) and a specified version number into aVersionInfo.rc that is compiled with my project. The pre-build event ...

SQL Date Interval Algorithm

I am currently writing a Delphi application that runs queries over a DB2 database using ADO. One of the requirements is that the user should be able to define queries using dates, for example "show me all data from the last 60 days" or "show me all data between November 20th 2009 and January 18th 2010". This wouldn't be an issue, excep...

Limit of PostMessage message size?

I'm sending a log message to the main form using this: For send the message: procedure LogMsg(Msg: string; Kind:TMsgType=msgNormal); var p: pChar; begin case Kind of msgError: Msg := '[Error] ' + Msg; msgInformation: Msg := '# ' + Msg; msgExternal: Msg := 'Plugin: ' + Msg; end;//if GetMem(p, (Length(Msg) + 1)*S...