AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Die Delphi-IDE IDE geht kaputt bei TFileSaveDialog und Vererbung
Thema durchsuchen
Ansicht
Themen-Optionen

IDE geht kaputt bei TFileSaveDialog und Vererbung

Ein Thema von Der schöne Günther · begonnen am 29. Jan 2018 · letzter Beitrag vom 29. Jan 2018
Antwort Antwort
Der schöne Günther

Registriert seit: 6. Mär 2013
6.110 Beiträge
 
Delphi 10 Seattle Enterprise
 
#1

IDE geht kaputt bei TFileSaveDialog und Vererbung

  Alt 29. Jan 2018, 17:55
Ist das nur bei mir so oder kann das jemand nachvollziehen?
  1. Neues VCL-Projekt anlegen
  2. Neuen VCL-Frame "Frame1" anlegen
  3. TFileSaveDialog auf Frame1 hinzufügen
  4. Ableitung von TFrame1 erstellen ("TFrame11"), Formular-Designer offen lassen
  5. Auf "TFrame1" den FileSaveDialog auswählen, im Objektinspektor "FileTypes" auswählen
  6. Neuen Eintrag erstellen
  7. Exception. TFrame11 (und damit das gesamte Projekt) kann fortan nicht mehr gespeichert werden. Exception tritt bei jedem Speichervorgang (oder z.B. Alt+F12) erneut auf

Delphi 10 Seattle

Fehlertext: "TFileTypeItem kann nicht zu TFileTypeItem zugewiesen werden."


Code:
[5015772D]{rtl230.bpl } System.Classes.TPersistent.AssignError (Line 5400, "System.Classes.pas" + 4) + $36
[50157775]{rtl230.bpl } System.Classes.TPersistent.AssignTo (Line 5405, "System.Classes.pas" + 0) + $1
[501576AB]{rtl230.bpl } System.Classes.TPersistent.Assign (Line 5390, "System.Classes.pas" + 0) + $7
[50157ECC]{rtl230.bpl } System.Classes.TCollection.Assign (Line 5692, "System.Classes.pas" + 10) + $24
[21195A58]{designide230.bpl} Update.TUpdateObject.Update (Line 1134, "Update.pas" + 54) + $E
[211959E8]{designide230.bpl} Update.TUpdateObject.Update (Line 1120, "Update.pas" + 40) + $3
[5005A19C]{rtl230.bpl } System.@FreeMem (Line 4650, "System.pas" + 20) + $0
[5005F5F8]{rtl230.bpl } System.TObject.FreeInstance (Line 16193, "System.pas" + 2) + $2
[5005F77C]{rtl230.bpl } System.TObject.Free (Line 16261, "System.pas" + 1) + $4
[21195638]{designide230.bpl} Update.UpdateOrder (Line 1036, "Update.pas" + 29) + $3
[21195A8D]{designide230.bpl} Update.TUpdateObject.Update (Line 1139, "Update.pas" + 59) + $9
[5005A19C]{rtl230.bpl } System.@FreeMem (Line 4650, "System.pas" + 20) + $0
[5006017C]{rtl230.bpl } System.TMonitor.Destroy (Line 17787, "System.pas" + 0) + $0
[5005F7FF]{rtl230.bpl } System.TObject.CleanupInstance (Line 16405, "System.pas" + 24) + $0
[5005A19C]{rtl230.bpl } System.@FreeMem (Line 4650, "System.pas" + 20) + $0
[5005F5F8]{rtl230.bpl } System.TObject.FreeInstance (Line 16193, "System.pas" + 2) + $2
[211964C5]{designide230.bpl} Update.TUpdateManager.Update (Line 1470, "Update.pas" + 22) + $9
[21195DB1]{designide230.bpl} Update.TUpdateManager.UpdateChildren (Line 1258, "Update.pas" + 2) + $A
[21195D78]{designide230.bpl} Update.TUpdateManager.Modified (Line 1240, "Update.pas" + 2) + $2
[211BD22A]{designide230.bpl} ComponentDesigner.TComponentRoot.ModifiedUpdateNotification (Line 3094, "ComponentDesigner.pas" + 2) + $8
[211BD364]{designide230.bpl} ComponentDesigner.TComponentRoot.Modified (Line 3114, "ComponentDesigner.pas" + 13) + $2
[211E7F38]{designide230.bpl} ColnEdit.TCollectionEditor.AddClick (Line 534, "ColnEdit.pas" + 21) + $B
[501714B7]{rtl230.bpl } System.Classes.TBasicAction.Execute (Line 16382, "System.Classes.pas" + 3) + $7
[5097C6FA]{vcl230.bpl } Vcl.ActnList.TCustomAction.Execute (Line 259, "Vcl.ActnList.pas" + 19) + $35
[5017130F]{rtl230.bpl } System.Classes.TBasicActionLink.Execute (Line 16293, "System.Classes.pas" + 2) + $7
[50993754]{vcl230.bpl } Vcl.Controls.TControl.Click (Line 7363, "Vcl.Controls.pas" + 7) + $7
[50A10DA8]{vcl230.bpl } Vcl.ComCtrls.TToolButton.Click (Line 21574, "Vcl.ComCtrls.pas" + 0) + $0
[50993C19]{vcl230.bpl } Vcl.Controls.TControl.WMLButtonUp (Line 7504, "Vcl.Controls.pas" + 7) + $6
[509931FD]{vcl230.bpl } Vcl.Controls.TControl.WndProc (Line 7249, "Vcl.Controls.pas" + 91) + $6
[50992E38]{vcl230.bpl } Vcl.Controls.TControl.Perform (Line 7027, "Vcl.Controls.pas" + 10) + $8
[50997452]{vcl230.bpl } Vcl.Controls.GetControlAtPos (Line 9809, "Vcl.Controls.pas" + 4) + $75
[5099751A]{vcl230.bpl } Vcl.Controls.TWinControl.ControlAtPos (Line 9832, "Vcl.Controls.pas" + 13) + $E
[50992E38]{vcl230.bpl } Vcl.Controls.TControl.Perform (Line 7027, "Vcl.Controls.pas" + 10) + $8
[509975E8]{vcl230.bpl } Vcl.Controls.TWinControl.IsControlMouseMsg (Line 9856, "Vcl.Controls.pas" + 15) + $29
[50997B9E]{vcl230.bpl } Vcl.Controls.TWinControl.WndProc (Line 10025, "Vcl.Controls.pas" + 104) + $6
[50A12EC1]{vcl230.bpl } Vcl.ComCtrls.TToolBar.UpdateButtonState (Line 22852, "Vcl.ComCtrls.pas" + 11) + $27
[50A12F02]{vcl230.bpl } Vcl.ComCtrls.TToolBar.UpdateButtonStates (Line 22863, "Vcl.ComCtrls.pas" + 3) + $4
[50A158E8]{vcl230.bpl } Vcl.ComCtrls.TToolBar.WndProc (Line 24441, "Vcl.ComCtrls.pas" + 104) + $6
[5099735C]{vcl230.bpl } Vcl.Controls.TWinControl.MainWndProc (Line 9786, "Vcl.Controls.pas" + 3) + $6
[50172214]{rtl230.bpl } System.Classes.StdWndProc (Line 16886, "System.Classes.pas" + 8) + $0
[2076C924]{coreide230.bpl} EditorStatusControls.TEditorStatusControlForm.RecordActionUpdate (Line 48, "EditorStatusControls.pas" + 6) + $1F
[50ADDCE0]{vcl230.bpl } Vcl.Forms.TApplication.StopHintTimer (Line 11171, "Vcl.Forms.pas" + 3) + $3
[50ADCB6F]{vcl230.bpl } Vcl.Forms.TApplication.ProcessMessage (Line 10443, "Vcl.Forms.pas" + 23) + $1
[50ADCBB2]{vcl230.bpl } Vcl.Forms.TApplication.HandleMessage (Line 10473, "Vcl.Forms.pas" + 1) + $4
[50ADCEE5]{vcl230.bpl } Vcl.Forms.TApplication.Run (Line 10611, "Vcl.Forms.pas" + 26) + $3
  Mit Zitat antworten Zitat
Benutzerbild von Uwe Raabe
Uwe Raabe

Registriert seit: 20. Jan 2006
Ort: Lübbecke
11.024 Beiträge
 
Delphi 12 Athens
 
#2

AW: IDE geht kaputt bei TFileSaveDialog und Vererbung

  Alt 29. Jan 2018, 18:41
Bekannter Fehler:

TFileTypeItem misses Assign method
Cannot assign a TFileTypeItem to a TFileTypeItem

Angesichts der geringen Votes scheint das aber keinen zu kratzen.
Uwe Raabe
Certified Delphi Master Developer
Embarcadero MVP
Blog: The Art of Delphi Programming
  Mit Zitat antworten Zitat
Der schöne Günther

Registriert seit: 6. Mär 2013
6.110 Beiträge
 
Delphi 10 Seattle Enterprise
 
#3

AW: IDE geht kaputt bei TFileSaveDialog und Vererbung

  Alt 29. Jan 2018, 18:48
Alles klar, vielen Dank!

Hatte mich schon gewundert dass das sonst niemandem aufgefallen wäre.
  Mit Zitat antworten Zitat
Fukiszo
(Gast)

n/a Beiträge
 
#4

AW: IDE geht kaputt bei TFileSaveDialog und Vererbung

  Alt 29. Jan 2018, 18:53
Ich glaub das gehört hier nicht hin da ja ein IDE/VCL fehler beschrieben wurde,
ich selbst nutz selten Delphi's VCL variante sondern diese hier:

Delphi-Quellcode:
{
How to use OpenSaveFileDialog
OpenDialog will have "Read-Only" Flag activated by default
while SaveDialog can "Overwrite" or "CreateNew"
  For example:
  1. to display the "OpenDialog" for text files
    s := 'aaa.txt';
    if OpenSaveFileDialog(Application.Handle, 'txt', 'Text Files|*.txt', 'c:\',
    'Select text file', s, True) then
      ShowMessage(s + ' file was selected for open')

  2. to display the "Save dialog":
    s := 'data.dbf';
    if OpenSaveFileDialog(Application.Handle, 'dbf', 'dBase tables|*.dbf|All files|*.*',
    'c:\', 'Select table', s, False) then
      ShowMessage(s + ' table was selected for save')
}

function OpenSaveFileDialog(ParentHandle: THandle; const DefExt, Filter, InitialDir, Title: string; var FileName: string; IsOpenDialog: Boolean): Boolean;
 function CharReplace(const Source: string; oldChar, newChar: Char): string;
  var
   i: Integer;
  begin
   Result := Source;
   for i := 1 to Length(Result) do
    if Result[i] = oldChar then
      Result[i] := newChar
  end;
var
  ofn: TOpenFileName;
  szFile: array[0..MAX_PATH] of Char;
begin
  Result := False;
  FillChar(ofn, SizeOf(TOpenFileName), #0);
  with ofn do
  begin
    lStructSize := SizeOf(TOpenFileName);
    hwndOwner := ParentHandle;
    lpstrFile := szFile;
    nMaxFile := SizeOf(szFile);
    if (Title <> '') then
      lpstrTitle := PChar(Title);
    if (InitialDir <> '') then
      lpstrInitialDir := PChar(InitialDir);
    StrPCopy(lpstrFile, FileName);
    lpstrFilter := PChar(CharReplace(Filter, '|', #0)+#0#0);
    if DefExt <> 'then
      lpstrDefExt := PChar(DefExt);
    if IsOpenDialog then Flags := OFN_EXPLORER or OFN_FILEMUSTEXIST or OFN_LONGNAMES or OFN_PATHMUSTEXIST or OFN_READONLY or OFN_NODEREFERENCELINKS or OFN_NONETWORKBUTTON or OFN_DONTADDTORECENT or OFN_FORCESHOWHIDDEN
   else Flags := OFN_EXPLORER or OFN_CREATEPROMPT or OFN_OVERWRITEPROMPT or OFN_LONGNAMES or OFN_PATHMUSTEXIST or OFN_NODEREFERENCELINKS or OFN_NONETWORKBUTTON or OFN_DONTADDTORECENT or OFN_FORCESHOWHIDDEN;
    FlagsEx := OFN_EX_NOPLACESBAR;
  end;
  if IsOpenDialog then
  begin
    if GetOpenFileName(ofn) then
    begin
      Result := True;
      FileName := StrPas(szFile);
    end;
  end
  else
  begin
    if GetSaveFileName(ofn) then
    begin
      Result := True;
      FileName := StrPas(szFile);
    end;
  end
end;
Achtung, nicht Unicode konform, selber ändern wenn nötig.

Grüße
  Mit Zitat antworten Zitat
Der schöne Günther

Registriert seit: 6. Mär 2013
6.110 Beiträge
 
Delphi 10 Seattle Enterprise
 
#5

AW: IDE geht kaputt bei TFileSaveDialog und Vererbung

  Alt 29. Jan 2018, 19:00
Danke, aber ... das ist ja noch so ein Win95-Dialog. Netter Trip in die Vergangenheit, aber ich glaube ich bleibe den TSaveDialog vorerst treu
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:24 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz