delphi

Closing modeless Rave Reports windows programmatically

Friends I use RR to produce print previews, based on a single TRVSystem (setting Modal to false, and redirecting the onPrint function to produce each preview, picking up and using the TBasereport. It works well, but I need to ensure that all modeless report windows are shut on program close in order to avoid exceptions. Do I need to l...

Changing editor fonts in RAD Studio 2009

I can change the editor font in RAD Studio 2009 under the [Tools][Options] Editor Options/Display settings form, but the list of fonts is very limited and does not show all the installed fonts. Is there any way to add fonts to the selection ? There is a work around by setting the font name in the registry, under [HKEY_CURRENT_USER\Softw...

Delphi 2009 button.enabled shows error in structure but still compiles

I'm just wondering if anyone else has come across this rather obtuse error. I have a procedure that looks loosely like this: procedure dostuff(); begin if session_started = true then // global var begin // do bunch of calculations // goes on for a while // then at the end we enable the save button save_score.enabled := ...

Why does MSHTML_TLB.pas produce warnings?

I am trying to get rid of lots of warnings in a project after converting it from BDS 2006 to Delphi 2009. The project needs a type library named MSHTML_TLB. The source file mshtml_tlb.pas is an incredibly large file (about 16MB and >440.000 lines of code) which is generated when the Type Library is imported into Delphi 2009. This f...

Delphi, how to avoid unicode warning message in D2009, D2010

In a sorting routine in Delphi 2007 I am using code like this: (txt[n] in ['0'..'9']) function ExtractNr(n: Integer; var txt: String): Int64; begin while (n <= Length(txt)) and (txt[n] in ['0'..'9']) do n:= n + 1; Result:= StrToInt64Def(Copy(txt, 1, (n - 1)), 0); Delete(txt, 1, (n - 1)); end; where txt is a string....

Delphi strings and reference counting

Delphi uses reference counting with strings. Do this mean that there is only one memory allocation for '1234567890' and all a,b,c,d, e and f.s reference to it? type TFoo = class s: string; end; const a = '1234567890'; b = a; c : string = a; var d: string; e: string; f: TFoo; function GetS...

What database should I choose not to worry about size limit?

Hi, I want to make rather simple database, which should store videofiles, and soundfiles. I wanted to use MS Access database (mdb), but this is limited to 2 GB. I do not want to use server - client solution, cause it should be single application using only local database stored on local harddrive. That's the idea. May you give me an ...

How to protect file system?

Hi, I want to store large files (videos, sounds) and access them via Database. I am balancing now between filesystem (references to files would be stored in DB) and pure DB (which could be enormously large after time). I have to protect the content too, so I thought, that DB solution suits better for this purpose. (probably it is not a...

Sort a string list: Move or exchange items only

In Delphi / Pascal I would like to sort a TStringList alphabetically. But for this purpose, I can only use the following two methods: Move: Moves a string from one index position to another, shifting other strings around as appropriate. Exchange: Swaps two strings in the list, as identified by their index positions. How could I do thi...

Playlist for music player in Delphi / List of multiple data items

I would like to have a playlist for my own music player in Delphi / Pascal. I thought that it would be the best solution to have a TStringList with the path of the MP3 file and - additionally - a TListBox with the song names. The matching strings in both lists must be at the same position. So if the user chooses item 5 in TListBox I can...

Delphi - Indy (IDHTTP) Keep Session

Ok, I have Idhttp created dynamically like the following procedure TForm1.Button1Click(Sender: TObject); Var Resp : String; begin Resp := webSession('https://www.website.com'); // HTTPS site requires session to keep alive if Length(Resp)>0 then MessageDlg('Got the body ok',mtInformation,[mbOk],0); end; function TF...

Is the MsComm ActiveX compatible with Delphi 2010?

I have ported our project from Delphi 7 to Delphi 2010. After adding some type casts now my project is running well and all the features work correctly except main functionality of the program which is bound to COM ports and the MSCOMM ActiveX component. It can read and write from a COM port but it seems something is wrong with that bec...

Delphi: Save TList of objects in text file

In Delphi I have the following classes: type TSong = class(TObject) private FArtist: String; FTitle: String; procedure SetArtist(Artist: String); procedure SetTitle(Title: String); public property Artist: String read FArtist Write SetArtist; property Title: String read FTitle Write SetTitle; constructor...

How to conjure Input mask Editor?

Hi, Is is possible somehow to pop up Input Mask Editor at run-time? I was looking for it on internet, but no success, it si not included in standard dialogs... I want user to make his own input mask... thanx ...

How filter a dataset based on a nested dataset record count?

I have a Dataset i want to apply a filter based on a dataset-type field record count, something like: 'NESTED_DATASET_FIELD.RecordCount > 0' ...

Can I write Windows drivers with Delphi 2010?

I've always heard that Delphi can do almost anything C++ can do...except write Windows drivers. Is this correct, and if so, why is that? I recently read a blog post online that may indicate a possible solution for writing drivers with Delphi, but it's 3 years old and I don't know how accurate this information is. So, with the latest v...

Delphi, Override Custom controls setCaption

i have a custom control, with the Ancestor being another custom control, who's Ancestor is a TPanel; i.e. TNotMyCustomControl = class(Tpanel); TMyCustomControl = class(TNotMyCustomControl); Is i possible to react when the Caption is being set (run time or design time), and still have the changed passed to the Ancestor controls? ...

Recommendations or comparisons on Indy's TidHTTPServer versus Delphi's TDSHTTPService

I need to implement a small, standalone web server that will be used to process REST API calls, using Delphi 2010. There seem to be two easy choices available with Delphi 2010 out of the box: Indy's TidHTTPServer and Delphi's own TDSHTTPService. I am familiar with Indy components and would probably use them without question; there is a...

Change CheckBox state without calling OnClick Event

I'm wondering so when I change state of CheckBox CheckBox->Checked=false; It calls CheckBoxOnClick Event , how to avoid it ? ...

How to remove focus from currently focused component?

I have a DB component which DataLink.UpdateRecord is called when it receives CM_EXIT message. This message is sent when it loses focus. When I click post button, it doesn't lose focus and value is not written to datasource. How can I reach an effect of component losing focus without switching it to other one? ...