2018-10-21         Page

Another bug in TDateTimePicker?

I found that after I set the MaxDate of a TDateTimePicker to a non zero value it's impossible to bring it back to zero (disable it). I mean, the MaxDate reads zero but the max range is still active to the value set before. This can be noticed by dropping down the calendar and checking the last visible date.Is this another bug, or I do not understand how to disable the MaxDate ?procedure TForm1.Button1Click(Sender: TObject);begin DateTimePicker1.MaxDate:= Date + 10; DateTimePicker1.MaxDate:= 0; Caption:= IntToStr(Trunc(Test.MaxDate));end;P.S: I take care of setting Time to z...

 delphi                     2 answers                     35 view
 2018-10-21         Sharon

How can I get those images shown in MessageDlg?

I want to make my own MessageDlg because the standard one does not have what I need. Is there a way to get those images (Error, Information, Warning...) and show them in my new MessageDlg ? At David's suggestion, here's how I did:procedure TSaveErrorDlg.FormCreate(Sender: TObject);var Ico: TIcon;begin Ico:= TIcon.Create; Ico.Handle:= LoadIcon(0, IDI_ERROR); if Ico.HandleAllocated then Image.Picture.Assign(Ico); Ico.Free;end; [XXX]

 delphi                     1 answers                     35 view
 2018-10-21         Marina

How detect if i'm moving mouse to left, right, top or bottom inside TImage component on mousemove event?

I want know how detect to what side i'm moving mouse: to left, right, top, bottom inside TImage component on mousemove event?Thank you. Here's an example to be used in an FMX project. For a VCL project, you would use integer variables.First, declare two variables Xold, Yold: single; for example in the private section of the form.private Xold, Yold: Single;Initialize these variables e.g. in the forms OnCreate() event. Using NaN requires System.Math in the uses clause.procedure TForm5.FormCreate(Sender: TObject);begin Xold := NaN; Yold := NaN;end;Then, in the OnMouseMov...

 delphi                     1 answers                     39 view
 2018-10-21         Oscar

Is it correct to consider Delphi's Format() function as an alternative to wsprintf()?

I want to know if it is correct to consider Delphi's Format() function to be an alternative to wsprintf()?I want to produce the same output as this:wsprintf( nameFile, "%s_%d_%08x.pfx", nameStore, c_certs, GetTickCount());ReferenceIn Delphi, I'm trying to use this:// Where "Mem" is a TMemoryStream variableMem.SaveToFile(NameStore + '_' + IntToStr(I) + '_' + Format('%08x', [GetTickCount]) + '.pfx'); Am I'm on the right track? Yes, that would be the most suitable alternative. You can come pretty close to the same exact syntax.wsprintf( nameFile, "%s_%d_%08x.pfx", nameStore...

 delphi                     1 answers                     39 view
 2018-10-21         Len

Generic helper classes in Delphi

I have a pair of classes, A and B, that must hold references to each other. This means that the interface uses clause of A must mention the unit of B, and the interface uses clause of B must mention the unit of A. This is a circular reference in Delphi and not allowed. I am solving the circularity by using the approach found here. Basically, A's reference to B is present as expected, but B's reference to A is demoted to a TObject reference, and B uses a helper class to cast the reference to A to the proper type. Here are code snippets to illustrate:unit A;interfaceuses B...

 delphi                     1 answers                     21 view
 2018-10-21         Derrick

delphi - how to use declare and use pointer to the const array in a const record?

I have a few const arrays of the same base type but different sizes, and I need to point to them in the const records. The code below compiles successfully, but finishes with error.type Toffsets = array of integer; Trec = record point1: Tpoint; //complete size point2: Tpoint; aOffsets: ^Toffsets; end;const cOffsetsA: array [0..3] of integer = (7, 4, 2, 9); cOffsetsB: array [0..5] of integer = (1, 2, 3, 4, 5, 6); cRec1: Trec = ( point1: (x: 140; y: 46); point2: (x: 5; y: 7); aOffsets: @cOffsetsA; ); ...

 delphi                     3 answers                     9 view
 2018-10-21         Benson

Problem starting program with a dll embedded as a resource

I've done About.com guide to embedding dll's in Delphi EXE's which seems to work, so long as I don't actually use the DLL as an external function. Is there anyway to get the code I linked to to work earlier than an unit referenced in the uses clause.I've tried: Doing exactly what this code says.Placing this code in the initialization section of the form that uses the unit that uses the external functions.Placing this code in the initialization section of the unit that uses the external functions.And by external functions I'm referring to a function that looks like:function...

 delphi                     3 answers                     13 view
 2018-10-21         Harlan

How to Prevent ProcessMessages in Delphi

The Application.ProcessMessages command is well known and I use it in long processes to ensure my program will not tie up the computer.But I have one fairly quick set of processing, where I am buffering a view into a file. During the buffering procedure, a few system messages may get sent off (e.g. redraw or scrollbar move or other events). I want to prevent these from getting handled by ProcessMessages until my buffering is complete.Is there any way to either:Prevent Application.ProcessMessages until my procedure is complete, orTrap all messages generated during my procedu...

 delphi                     4 answers                     60 view
 2018-10-21         Verne

Copy TClientDataSet contents with field configurations

I would like to copy a whole TClientDataSet instance into another so I can recover any changes made in the original one. I've tried to saveToStream, to copy the data property but in all cases I loose the fields configurations (displayLabel, size, etc.)Is there a way to do what I'm trying? Delphi will only stream published properties. You may need to tweak things a bit to get everything out & back correctly. See http://www.delphipages.com/news/detaildocs.cfm?ID=145 for an example of the hooks.-- MarkusQ [XXX]This should work:DestClientDataSet.Data := SrcClientDat...

 delphi                     3 answers                     74 view
 2018-10-21         Leila

How do I send e-mail using Gmail's SMTP and Indy 10?

I'm using Delphi 2009 and the lastest Indy 10 from svn to send e-mails using SMTP, but it doesn't work with Gmail (Google Apps hosted domain). When I try to send an e-mail I get "Must issue a STARTTLS command first".I tried Googling about it and I found several forums and several solutions, but they all just bashed some code or just said I needed an OpenSLL DLL, which so far isn't very clear to me exactly what I need.Can someone please tell exactly which DLL I need and what do I have to change in the my TIdSMTP and TIdMessage objects in order to send the e-mails through Gma...

 delphi                     1 answers                     61 view
 2018-10-22         Todd

Delphi - Sending Records as Window Messages

Delphi Tokyo - I am wanting to send a record structure between forms via Windows Messages. Specifically, I have a "display running status" type of window. When behaviors occur elsewhere in my application, I need to send an "update the status window" type of message. I have found an example which passes a record via windows messages (but only within the same process), but am having issues making it work. Specifically, on the receiving side, I am having trouble compiling the windows message handler code. I have an 'Incompatible Type' error, but I can't figure out how to ty...

 delphi                     1 answers                     58 view
 2018-10-22         Viola

Delphi apps, form size varies on different machines

I've got a Delphi 7 app, on the WinXP development machine the form size is the same as it was designed.However, running the app on a Vista machine, some forms have been enlarged 20-30%, leaving big blank spaces on the right and bottom edge of forms.On one of our client's WinXP machine, the forms have shrink, causing scroll bars to show up on the forms.On most other machines, it shows up OK.The app does remember the form size that was last used on some forms, and uses it next time the form is opened, however even removing these settings, the default form size is still differ...

 delphi                     3 answers                     32 view
 2018-10-22         Gustave

What features are the most important for data-bound grid controls

Certain features for data-bound grid controls are a given and should be available in any grid. Like rows and columns (other layouts are possible in many) and checkboxes for boolean values with text representation for other values. But many grid controls offer a cacophony of features that may not be applicable to all of the use cases. Some of these are:Multi-level data, with master rows that can be expanded to reveal detail rows. Potentially, these detail rows can have different columns and potentially these detail rows can be expanded to show additional detail levels.Drag-a...

 delphi                     1 answers                     77 view
 2018-10-22         Avery

Does Delphi sometimes revert text form files (DFM) to binary format?

Our Delphi 7 development team stores form files (dfm) in text mode, and uses a source control system (Subversion) to track changes.Sometimes, we noticed that a form file returned to binary format between revisions, causing diff tools like TortoiseMerge to complain.Using the Subversion change log, I can see that the DFM file was stored in text form before. The software developers never change the storage file format back to binary manually.Have you encountered the same? Is it a known problem? I have seen it happen in Delphi 7 when a form inheriting from another form from ...

 delphi                     8 answers                     42 view
 2018-10-22         Salome

Is there a way to locate unused event handlers in Delphi?

Finding dead code in Delphi is usually real simple: just compile and then scan for routines missing their blue dots. The smart linker's very good about tracking them down, most of the time.Problem is, this doesn't work for event handlers because they're published methods, which (theoretically) could be invoked via RTTI somehow, even though this almost never happens in actual practice.I'm trying to clean up a large VCL form unit that's been bent, folded, spindled and mutilated various times throughout its history. It would sure be nice if I had some way to find event handl...

 delphi                     7 answers                     18 view
 2018-10-22         Rosalind

EIPHTTPProtocolExceptionPeer exception using PutBlock with array of bytes all set to zero

Using Delphi XE2 Update 3 I'm having a problem uploading a block of zero bytes to Azure. When I say zero bytes, I mean an array of bytes with each element set to zero (it's not zero length).For example:var ConInfo: TAzureConnectionInfo; RespInfo: TCloudResponseInfo; BlobService: TAzureBlobService; Content: TBytes; MD5: String; Hasher: TIdHashMessageDigest5;begin ConInfo:=TAzureConnectionInfo.Create(self); ConInfo.AccountName:='YOUR ACCOUNT NAME'; ConInfo.AccountKey:='YOUR ACCOUNT KEY'; ConInfo.Protocol:='http'; BlobService:=TAzureBlobService.Create(ConInfo); ...

 delphi                     1 answers                     23 view

Page 1 of 164  |  Show More Pages:  Top Prev Next Last