-
Content Count
1944 -
Joined
-
Last visited
-
Days Won
25
Everything posted by Attila Kovacs
-
Using uninitialized object works on Win32, throws AV on Win64
Attila Kovacs replied to aehimself's topic in General Help
Really? And what if the var in the sub-roc is passed further? How deep do you want the compiler work for you? What if the decision is based on a variant? Should the compiler evaluate every outcomes? How slow should be the compiler just for your entertainment? Buy TMS FixInsight, write unit tests and first of all, develop a coding pattern which doesn't even uses such pitfalls. -
Using uninitialized object works on Win32, throws AV on Win64
Attila Kovacs replied to aehimself's topic in General Help
It's not the compilers job to do code analysis for you? -
Using uninitialized object works on Win32, throws AV on Win64
Attila Kovacs replied to aehimself's topic in General Help
As a comment? 😉 -
Using uninitialized object works on Win32, throws AV on Win64
Attila Kovacs replied to aehimself's topic in General Help
I'll downvote it. -
Class properties: Wins prettyness over functionality ?
Attila Kovacs replied to Rollo62's topic in Algorithms, Data Structures and Class Design
these are just your own patterns, no guarantee, it's just made up, also, calcX can be a one liner or a power-plant burner 🙂 -
Class properties: Wins prettyness over functionality ?
Attila Kovacs replied to Rollo62's topic in Algorithms, Data Structures and Class Design
they have index you can inherit the accessors they have nice RTTI support, can be decorated the h*ll are you talking about, how should be a GetThis() more verbose about its implementation as a property? -
Class methods Polyformism
Attila Kovacs replied to Sam Witse's topic in Algorithms, Data Structures and Class Design
this is it: class function TMaster.GetMasterId: integer; begin writeln(classname); // Result := GetChildID; { <= at this point I get an abstract error } end;- 8 replies
-
- class method
- polyformism
-
(and 1 more)
Tagged with:
-
Class methods Polyformism
Attila Kovacs replied to Sam Witse's topic in Algorithms, Data Structures and Class Design
The compiler should read the docs and give some hint, if it's not already the case. At least at the "override".- 8 replies
-
- class method
- polyformism
-
(and 1 more)
Tagged with:
-
ISO8901: Week numbers and year
Attila Kovacs replied to Keesver's topic in RTL and Delphi Object Pascal
There is no such thing in Delphi. You have to roll your own. Should not be that hard. -
Which option to use for a large batch of REST queries?
Attila Kovacs replied to David Schwartz's topic in OmniThreadLibrary
I'm using "pipeline" for a multi downloader, with my "download" and "import" stages. It's really cool. -
Are the column indexes still the same? The tlte seems different. I'm not using icons so I never encountered such thing.
-
in the Vcl.SvcMgr.pas / procedure TServiceApplication.Run; there are these two lines: if StartThread.ReturnValue <> 0 then FEventLogger.LogMessage(SysErrorMessage(StartThread.ReturnValue)); where LogMessage (windows ReportEvent()) gets a string parameter containing an error message and having 3 other parameters filled with default values: EventType=1, Category=0, ID=0. Now, every time this LogMessage is called, in the Event Logs I see an entry with ID=0 and the message is not the one passed to this method but the translated error message (to the windows' current language) of the ID=0. (Or some similar mechanism which I'm not aware of.) Like I'm having always: "Der Vorgang wurde erfolgreich beendet." ID = 0. But if I'm also passing the error code to LogMessage, like: FEventLogger.LogMessage(SysErrorMessage(StartThread.ReturnValue), 1, 0, StartThread.ReturnValue); then in the event viewer are the right messages. Also, the message parameter (the first parameter) will be inserted in those messages if there is a placeholder for that. Did something change since Windows NT or ist it a longstanding bug or do I miss something?
-
btw. is there any default table provided by delphi?
-
I believe you but I'm not dreaming.
-
toAutoSpanColumns
-
Yes
-
@Anders Melander I've installed the VTune Profiler 2022.1.0/621966 and loaded an exe with a 31MB pdb and the hotspot analysis took about a minute. I think this was way slower back in the days you wrote the converter. Give it a try on an other machine.
-
I've downloaded the "latest" VTune Profiler, 2022.1 but it doesn't even touches the pdb file. Luckily I'm not using this app at all. edit: forgot to bind... stay tuned
-
No, the problem will be MapiLogon, don't use MapiLogon. Try this unit and give us feedback
-
BestPractices: To raise, or not to raise ... an Exception in a class constructor
Attila Kovacs replied to Rollo62's topic in Algorithms, Data Structures and Class Design
What is the problem with conventional coding? Why the ascii art and why not use some properties and a normal try finally? -
BestPractices: To raise, or not to raise ... an Exception in a class constructor
Attila Kovacs replied to Rollo62's topic in Algorithms, Data Structures and Class Design
But as a Library-Writer, this validation is a Plus, and not a "guard" for the rest of the code 😉 -
BestPractices: To raise, or not to raise ... an Exception in a class constructor
Attila Kovacs replied to Rollo62's topic in Algorithms, Data Structures and Class Design
ok, you are right, I missed a lot from the beginning, my apologies -
BestPractices: To raise, or not to raise ... an Exception in a class constructor
Attila Kovacs replied to Rollo62's topic in Algorithms, Data Structures and Class Design
I would eventually, if I'm using them in the constructor. Eventually, as I'm not sure that an exception("I'm dumb") is better than an AV. If I'm not using them in the constructor, there is no reason to validate them. Also, it can be still trash because it's not nil. -
BestPractices: To raise, or not to raise ... an Exception in a class constructor
Attila Kovacs replied to Rollo62's topic in Algorithms, Data Structures and Class Design
he has no problems with memory management, he even made it clear in just a couple of replies above so I have no idea what you trying to prove here -
BestPractices: To raise, or not to raise ... an Exception in a class constructor
Attila Kovacs replied to Rollo62's topic in Algorithms, Data Structures and Class Design
Must be a very rare occasion where the parameter type itself does not cover the validity and the validity would not change with time, as far as I can think of. In this case of course a validation is not avoidable. However, I still think, that that is not the case behind the problem because it should be such rare, that he would not brought it up. I suspect over- and early-validation. At least, my advice was, not to do them if not neccessary.