Bonjour,
Je suis tombé sur cette page du wiki.
Ils donnent le code suivant :
Il n'y a pas de libération du TTaskDialog à la fin du traitement. C'est un oubli ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 procedure TForm1.FormCreate(Sender: TObject); var TaskDialog: TTaskDialog; Button: TTaskDialogBaseButtonItem; begin // display a task message dialog at a certain position TaskMessageDlgPos('Continue', 'Are you sure you want to continue?', mtWarning, mbYesNoCancel, 0, 10, 10); // display another message dialog at the current position TaskMessageDlg('Error', 'An error has occured', mtError, mbAbortRetryIgnore, 0); // create a custom task dialog TaskDialog := TTaskDialog.Create(Self); TaskDialog.Title := 'An error has occured in the query.'; TaskDialog.Caption := 'Query result'; // assign a MB_OK modal result to the task dialog TaskDialog.ModalResult := MB_OK; // add some customized buttons to the task dialog Button := TaskDialog.Buttons.Add; Button.Caption := 'Continue'; Button.ModalResult := MB_OK; Button := TaskDialog.Buttons.Add; Button.Caption := 'Retry'; Button.ModalResult := MB_RETRYCANCEL; // display the dialog box TaskDialog.Execute; end;
Lié à ces histoires de libération, lorsque j'ajoute manuellement des composants dans un form, sont-ils bien détruits automatiquement à la fermeture du form ?
Partager