delphi

Are TClientDataSets part of your toolkit, or have they been replaced by something else?

I have 50 or 60 records of four or five fields. I need to load the records into RAM (From a CSV file), search on different fields, enumerate, etc. Not a lot of data, not a lot of functionality. I was all excited to use the new (to me in D2010) TDictionary or TList, but thought that a TClientDataset (which I've never used before) might ...

Auto sizing column in TVirtualStringTree

Climbing the learning mountain of TVirtualTreeView, I'm attempting to create a custom descendant that ensures that, when the control is resized, the width of the last column exactly fills control's width without requiring a horizontal scroll bar. I see a number of items (a method and a number of events) pertaining to "AutoFitColumns", b...

Delphi - Create form behind another form.

I'm using Delphi 4. I have a main form with a button that dynamically creates a new form. I'd like the new form to be visible, but to show up BEHIND the main form. I've tried calling SendToBack() immediately after FormCreate(). But that makes the window flicker quickly before it's actually sent to back. I've tried making the form invis...

Is Valid IMAGE_DOS_SIGNATURE

I want to check a file has a valid IMAGE_DOS_SIGNATURE (MZ) function isMZ(FileName : String) : boolean; var Signature: Word; fexe: TFileStream; begin result:=false; try fexe := TFileStream.Create(FileName, fmOpenRead or fmShareDenyNone); fexe.ReadBuffer(Signature, SizeOf(Signature)); if Signature = $5A4D { 'MZ' } then result:=...

Delphi - How can I prevent the main form capturing keystrokes in a TMemo on another non-modal form?

I have an app that opens a non-modal form from the main form. The non-modal form has a TMemo on it. The main form menu uses "space" as one of its accelerator characters. When the non-modal form is open and the memo has focus, every time I try to enter a space into the memo on the non-modal form, the main form event for the "space" sho...

TStringList, Dynamic Array or Linked List in Delphi?

I have a choice. I have a number of already ordered strings that I need to store and access. It looks like I can choose between using: A TStringList A Dynamic Array of strings, and A Linked List of strings (singly linked) and Alan in his comment suggested I also add to the choices: TList<string> In what circumstances is each of the...

The same property and procedure in different Classes. How they can be accessed ?

Hi, I created several new objects TMyMemo = class (TMemo) private FYahoo = Integer; procedure SetYahoo(Value:integer) public procedure Google(A,B:integer; S:string); published property Yahoo:integer read FYahoo write SetYahoo; end; TMyPaintbox = class (TPaintbox) private FYahoo = Integer; procedure SetYahoo(Value:integer)...

Run an ActiveX through Web

We have a webpage that works fine on the local computer as it uses a COM Object that is only available in the local computer. the program generates HTML code: <html> <head> <script type="text/javascript"> <!-- function ResizeControl(){Y = document.body.clientHeight;if (Y < 1) {Y = 1}X = document.body.clientWidth;if (...

Looking for solution to persist rows sequence in a database table that allow efficient reordering at runtime

I have a database table. There is a field name "Sequence" that indicate sequence when user presents the rows in report or grid visually. When the rows are retrieved and presented in a grid, there are few UI gadget that allow user to reorder the rows arbitrary. The new sequence will be persist in database table when user commit the cha...

Disable hotkey on vcl controls

I do have a TPageControl that I do add and remove TTabsheet's from, and in the TTabsheets there are 2 TEdit's that the user can type firstname and lastname, when they do the Tab Caption does show what they have written. But if the user add a '&' somewhere in the TEdit (and they are allowed to do) the tab do get the char after '&' as (un...

Delphi: EReadError with message ‘Property PageNr does Not Exist’.

Hi, I get SOMETIMES error message: EReadError with message 'Property PageNr does Not exist', when I try to run my own project. I am really desperate, because I see simply nothing what is the cause. The devilish is that it comes up sometimes but often. It concerns of my own component TPage. Here is declaration> TPage = class(TCustomCont...

Delphi - Hidden MDI child form creation

Hi My application has many many mdi forms and they are created after successfull user login. How can I best hide this creation process? It looks stupid and it takes longer time while mdi forms are painted after new form is created and so on. So far I have used LockWindowUpdate, which doesn't hide everything, but I would like to use a s...

Using TXMLDocument to serialize form settings to XML and database.

I have an interface: type IXMLSerializable = interface function SaveToXML : DOMString; function SaveToXMLDocument : IXMLDocument; procedure LoadFromXML(AXML : DOMString); end; It is used to serialize some settings of forms or frames to xml. Simple implementation: SaveToXMLDocument: function TSomething.SaveToXMLDocument: IXMLD...

how SendMailMAPI is adjusted to support multiple file attachments

I have this code that sends just one attachment by time, how can I adjust this code to send 1-2 attachments? function SendMailMAPI(const Subject, Body, FileName, SenderName, SenderEMail, RecepientName, RecepientEMail: String) : Integer; var message: TMapiMessage; lpSender, lpRecepient: TMapiRecipDesc; FileAttac...

RichEdit's EM_AUTOURLDETECT message not always sent

To describe this issue, the best would that you would test my application with following usecase: Application: http://ubuntuone.com/p/nF/ Open application; Click on the ">" captioned button; Click on same button again; Click on the same button again. As you can see - URL is correctly detected in first expanding, but in any further ...

Connecting to SQL Server database via Web service

1.) I can create a simple application which has one routine called function ConnectToDB: Boolean and run it from my virtual directory (wwwroot/cgi-bin) and it connects and reports back connected . 2.) I can create a simple web service helloWorld function helloWorld: String;stdcall; I can create a client and call my web service ca...

How to place multiple formats on the clipboard?

For example, what Wordpad did when I press "Ctrl+C"? It places many different format to clipboard. So Notepad can get the text without any color or font...etc, and you still can keep the original format when you paste in another Wordpad window. The MSDN said I should call SetClipboardData multiple times. But it doesn't work at all. ...

Delphi 7 and EMF+ files

I have an application that can load various graphical file formats such as bmp, jpg, png, emf, etc... and render them onto the screen for previewing. I am using Delphi 7. I have just been introduced to the EMF+ file format that was created around the time of Windows XP that is created utilizing the GDIPlus.dll. I can open the EMF+ file...

Getting authentication token after a HttpSendRequest

The following code will log in my application to a server. That server will return an authentication token if the login is successful. I need to use that token to query the server for information. egressMsg := pchar('email='+LabeledEdit1.text+'&&password='+MaskEdit1.Text+#0); egressMsg64 := pchar(Encode64(egressMsg)); Reserved :=...

Does Delphi 2006 work inside VirtualBox?

I'm getting a lot of error messages, as well as slow performance. ... Is there a workaround? (I heard Delphi 2007 does not work inside VirtualBox.) ...