All that's true, and I know that!
We are just one step close to solution!
I need code that will be Free (and nil) closed descendant Form:
procedure TGForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:= caFree;
GForm := nil; // here need to be something different to...
No, there is nothing specific in closing any of TXForm, TYForm and TZForm forms! I just want to avoid duplicating actually same code on all of descending forms in their OnClose event.
So, if possible, one code on TGForm that will close any (so, NOT ALL, but just concrete one!) descendant form.
Yes, exactly that!
All that I knew before, just don't know:
WHAT CODE to put in on OnClose for TGForm so that code will be recognize which exactly form is calling them - TXForm or TYForm or TZForm or... and Close that form?
One more attempt:
I make 'generic' Form (GForm) and put them into Delphi Repository (so I DON'T create GForm in my Project, I just use them to INHERIT other forms!).
GForm is ancestor for several forms in my Project: XForm, YForm, ZForm,... (all of them are created from Repository, inheriting...
I have SQL Server 2008 Stored Procedure that uses uniqueidentifier type of Parameter.
When try to open ADOStoredProc1 related with this SP in my Delphi Project, this error occurs:
Invalid character value for cast specification.
Delphi recognizes this Parameter as ftGuid DataType.
What other...
My intention is to Free and nil anyone of DESCENDANT Forms (TForm2 = class(TForm1), TForm3 = class(TForm2),...) trough Form1.FormClose procedure:
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:= caFree;
Form1 := nil;
// or, maybe like DjangMan says, just...
Yes, this was same I try first, but...
Something is wrong, because when after
Self.Free; // or Self := nil; (what is actually Form2 := nil)
I check this condition:
if not Assigned(Form2) then
...
program behave like Form2 IS NOT NIL!?!?!?
BobaFet, Thanks anyway!
Form1 is ancestor Form, and had this code in Form1.FormClose:
...
Action:= caFree;
Form1 := nil;
end;
Form2 is derived from Form1 (TForm2 = class(TForm1).
What should write instead of Form1 := nil in Form1.FormClose to be sure that (inherited) Form2 is also nil after Close?
Delphi2007 Repository had very strange behavior:
refuses to remember new Categories and new items I've add to it.
Actually, I can add both of them, but next time I try to open from Repository, they didn't appear there?!
Configuration: Delphi2007 for Win32® R2 Version 11.0.2902.10471, Windows 7...
Is there an tool that can index content od files (.doc, .pdf) that are stored in FileStream?
Intention is to make possible to search stored files by indexed content.
Right click on Computer icon on Desktop, then Manage and following error occurs:
"The file does not have a program associated with it for performing tis action.(...)"
When starts Computer management from Administrative tools, everything is OK.
Any idea?
towerbase,
thanks for your persistency!
I put:
ShortDateFormat := 'dd.mm.yyyy.';
LongDateFormat := 'dd.mm.yyyy.';
ShowMessage( DateToStr( Now ) );
and now output is really: '04.01.2010.'.
But, when try something like this:
myDate := StrToDate(FormatDateTime('dd.mm.yyyy.', Now))...
My computer's Regional settings uses this format for Date:
dd.MM.yyyy.
(for both, Short and Lond Date format).
So, it IS same like in my code (I try even to change dd.mm.yyyy. to dd.MM.yyyy. but same error occurs).
OS is Windows 7, maybe this make problem?!
'27.01.2009.' is just as example, to clearly see what is Day and what is Month in Date format I need. ((if I put other Date, like 03.01.2010. it will not be clear))
What is more important:
Error message "'27.01.2009.' is not a valid date."
occurs not in FormatDateTime function, but when I call...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.