-
Content Count
1943 -
Joined
-
Last visited
-
Days Won
25
Everything posted by Attila Kovacs
-
How to get ThisFormClass (TForm1) from Form1
Attila Kovacs replied to Qasim Shahzad's topic in Algorithms, Data Structures and Class Design
This is pretty true for everything in life. This is all made up, there is no need to mix anything, there should be rules to follow and that's it. I'd also find the problem in a very short time. Also, where would you store all the opened non-modal forms and why would you do that in first place? Let me guess, are those "big, complex projects" which are full of cross-form references? Form2.Edit.Text := 'lala'?- 20 replies
-
- form creation
- refactoring
-
(and 3 more)
Tagged with:
-
Haha, thx Dany, I have to admit I'm really busy with other things these days and also, his avatar mesmerizes me all the time I'm seeing it. But I'll keep an eye on him from now on 😄
-
How to get ThisFormClass (TForm1) from Form1
Attila Kovacs replied to Qasim Shahzad's topic in Algorithms, Data Structures and Class Design
there is no problem with that pattern and there is no simpler pattern and it introduces no unnecessary dependencies- 20 replies
-
- form creation
- refactoring
-
(and 3 more)
Tagged with:
-
Ahh, it's you again, emailx45 the warez king and comic book flooder. <o>
-
The original PDF has -who know how much- more pages so it's not on the page 71, as I said, it's almost impossible to find his reference after making a slapstick comedy from that document.
-
It's hard to find that reference after you made 100 new editions without any official source.
-
@joaodanet2018 I have the strong suspicion that you are pasting into this forum -in some uniquely ugly way- everything you can google up. Why?
-
So it's working as expected?
-
What do you want to say with that?
-
#define WM_UAHDESTROYWINDOW 0x0090 // handled by DefWindowProc and the comment should give some hint why are there different messages
-
More efficient string handling
Attila Kovacs replied to parallax's topic in Algorithms, Data Structures and Class Design
I'd be surprised if FILE_FLAG_SEQUENTIAL_SCAN would give any notable boost. -
More efficient string handling
Attila Kovacs replied to parallax's topic in Algorithms, Data Structures and Class Design
Not sure? That's interesting, you could save 150 secs and a bunch of coding but you are don't bother to find out? double double quotes are escaped double quotes but you can go the explicit way: FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '' -
More efficient string handling
Attila Kovacs replied to parallax's topic in Algorithms, Data Structures and Class Design
No, I didn't say no conversation, I said LOAD DATA can be told what to do. So either I'm still missing something or you did not check the help on LOAD DATA? LOAD DATA INFILE '/path/to/temp_test.csv' IGNORE INTO TABLE temp_test FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' -- or '\n' IGNORE 1 LINES (@c1, @c2) SET c1 = STR_TO_DATE(@c1,'%d-%b-%y %H:%i:%s') ,SET c2 = (@c2 = 'True'); -
More efficient string handling
Attila Kovacs replied to parallax's topic in Algorithms, Data Structures and Class Design
I would not do that to myself but I'm a lazy dog. However, I'm not sure if we should ignore the original problem, LOAD DATA not want to have double quotes or wrong date format etc... because AFAIR it can be told both. -
More efficient string handling
Attila Kovacs replied to parallax's topic in Algorithms, Data Structures and Class Design
I understand now. And why would their disks write faster from a different thread? More pressure? 😉 By the way, you can tell load data to handle double quotes and stuff. -
More efficient string handling
Attila Kovacs replied to parallax's topic in Algorithms, Data Structures and Class Design
How often do you have to import that file? -
More efficient string handling
Attila Kovacs replied to parallax's topic in Algorithms, Data Structures and Class Design
why do you need writefile more than once? how much gigabytes is that csv? -
Any GraphQL implementation out there?
Attila Kovacs replied to Javier TarÃ's topic in Network, Cloud and Web
Cool 😉 -
Suggestion: Debugger inspection templates for complex types
Attila Kovacs replied to Lars Fosdal's topic in Delphi IDE and APIs
Ah that, I see, you're right, no prob at all. -
this makes an app unpinnable: uses Winapi.Windows, Winapi.ShlObj, Winapi.ShellAPI, Winapi.ActiveX, Winapi.PropSys, Vcl.Forms, .. function MarkWindowAsUnpinnable(Ahwnd: hwnd): HResult; const VARIANT_TRUE = WordBool(-1); PKEY_AppUserModel_PreventPinning: TPropertyKey = (fmtid: '{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}'; pid: 9); var pps: IPropertyStore; hr: HResult; v: PROPVARIANT; begin hr := SHGetPropertyStoreForWindow(Ahwnd, IID_IPropertyStore, pointer(pps)); if Succeeded(hr) then begin // pps._AddRef; v.vt := VT_BOOL; v.boolVal := VARIANT_TRUE; hr := pps.SetValue(PKEY_AppUserModel_PreventPinning, v); // pps._Release; end; Result := hr; end; ... Application.CreateForm(TMainForm, MainForm); MarkWindowAsUnpinnable(Application.MainForm.Handle); I'm not sure about the pps._addref and pps._release, I would appreciate some help on that. thx
-
Navigation Toolbar
-
Using translations in unit Consts with Delphi 10.4 VCL
Attila Kovacs replied to Dirk Janssens's topic in VCL
This will only work if you have the sources for every components you are using and you also build them all at least once at building the release version aaaand your units will be found earlier than the dcu's in Delphi's lib directory. So it wasn't for me, I'm using this: const MY_SMsgDlgConfirm = 'Moooooooo'; implementation procedure HookResourceString(rs: PResStringRec; newStr: PChar); var oldprotect: DWORD; begin VirtualProtect(rs, SizeOf(rs^), PAGE_EXECUTE_READWRITE, @oldprotect); rs^.Identifier := Integer(newStr); VirtualProtect(rs, SizeOf(rs^), oldprotect, @oldprotect); end; initialization HookResourceString(@SMsgDlgConfirm, MY_SMsgDlgConfirm); No one ever complained about it. Was it originaly from you @PeterBelow? http://www.delphigroups.info/2/92/298063.html -
Suggestion: Debugger inspection templates for complex types
Attila Kovacs replied to Lars Fosdal's topic in Delphi IDE and APIs
I'm not sure this would change anything as it works the same way. I have rather close debug windows and delete watches if I want step through the code, otherwise it's really slow. -
Suggestion: Debugger inspection templates for complex types
Attila Kovacs replied to Lars Fosdal's topic in Delphi IDE and APIs
you could do that from an expert but accessing (copying) the memory from the applications thread is very slow and not always work (as expected) -
Nothing, I was unsure how to translate it properly without surprises later. I took some C or C# example as a base.