-
Content Count
1209 -
Joined
-
Last visited
-
Days Won
25
Posts posted by Sherlock
-
-
Slightly OT: dhsPinger has an ominous ring to it. Pinging the DHS sounds like something you should not do lightheartedly.
- 1
- 1
-
9 hours ago, Remy Lebeau said:I really wish Delphi would stop mimicking DotNet. Delphi IS NOT DotNet!
Aye, there's the rub.
I propose exchanging DotNet with <SomeLanguage>. But folks keep saying "I want <SomeLanguage> feature x, because that is so cool, and I simply can't write my application without it". And then we get some half cooked thing which resembles <SomeLanguage> feature x by intent, but is buggy and breaks other stuff...
-
2 hours ago, David Heffernan said:A painful read from a development team that has bitten off way more than it can chew.
Something tells me, it was not the team that took that bite...
-
Yeah, all the cool kids want to JavaScript, while banks and insurance companies are going out of their way to pay regal salaries to those old COBOL geezers. COBOL delivers, where JS just looks shiny.
- 2
-
I didn't read the book, but I'm guessing that only applies when you add those programmers to the same problem. Luckily Delphi has a ton of problems, that could each feed a programmer for at least a month
- 6
- 5
-
12 minutes ago, Rollo62 said:Don't mess with youself too much,
if Microsoft shows not any attempt to make these controls practically more usable since the last 20+ years, why should we do ?I must really say that meanwhile I hate to fix all the quirks in OS, IDE, tools, libraries, etc.
Enough to do with my own, selfmade errorsAnd in the end, what is the effort worth? Just to say: "In my product 1+1 is still 2 but it looks better than the others".
-
4 minutes ago, Rollo62 said:When you looking for VCL, probably you have to create you own custom component,
or you simply use ' ' space, to get more distance tho the checkbox.That will fail quickly for word wrapped captions.
-
12 minutes ago, Rollo62 said:That shows the core differences in the different languages:
C++ = pointer love
Delphi = pointer hateBut why: pointers are always, and will be always out there, till the end of days (at least when it comes to the bare metal).
I don't hate them, I just don't need them. 😉
- 1
- 1
-
I have gone through the code and replaced those pesky FreeAndNils with FreeMem or Dispose, whatever fit. It compiles fine now, but next step is to redesign the code to get rid of those ancient pointer thingies altogether. Quite annoying.
Thanks everyone for your help and insight!
-
8 minutes ago, Uwe Raabe said:Either someone didn't understand FreeAndNil or the code used TObject in the first place and later changed to a typed pointer, but forgot to adjust the FreeAndNil call.
You could think that to be the reason, but I'm looking at code with tons of PArrayOfByte like what I posted. This seems like some very, very old code and an array of byte is rarely implemented as a class is it? Much less back in the olden days.
-
@Dalija Prasnikar Thank you! I thought that might be the reason. Which brings me to my earlier question: Why use FreeAndNil on Pointers in the first place? Do you have any idea?
-
So I've been digging into some component codes just for the heck of it, and stumbled across a whole lot of code like the following snippet:
procedure Foo; var Bar: PArrayOfByte; begin // Do some more or less elaborate thing with Bar // and in the end FreeAndNil(Bar); end;
Now, first off, that is not how I had understood FreeAndNil. I always thought it to be usable for object instances. Of course one could argue, that whatever is behind a pointer could be an object itself, but I mean some thingy that was created via a TObject.Create. And sure enough, Delphi 10.4 will no longer compile stunts like these. It will give an E2010 and bluntly state that TObject and PArrayOfByte are not compatible. And rightly so.
So...What to do? How to fix? Given that (in the above crude example) Bar must have been allocated memory via System.GetMem or System.New, System.FreeMem or Sysem.Dispose will do the trick, right?
Why was this not done in the first place, though? Why mix paradigms at the risk of creating some unholy entity mucking up the entire system?
Perhaps looking into FreeAndNil will enlighten us?
This is 10.3.1s take on that method:
procedure FreeAndNil(var Obj); {$IF not Defined(AUTOREFCOUNT)} var Temp: TObject; begin Temp := TObject(Obj); Pointer(Obj) := nil; Temp.Free; end; {$ELSE} begin TObject(Obj) := nil; end; {$ENDIF}
And here is what 10.4 considers to be correct:
procedure FreeAndNil(const [ref] Obj: TObject); {$IF not Defined(AUTOREFCOUNT)} var Temp: TObject; begin Temp := Obj; TObject(Pointer(@Obj)^) := nil; Temp.Free; end; {$ELSE} begin Obj := nil; end; {$ENDIF}
Subtle, innit? Now FreeAndNil requires the thing it's supposed to free and nil to be of TObject, which is cool. But it also considers it to be const...why is that? I learned const renders the parameter unmodifiable, see here: http://docwiki.embarcadero.com/RADStudio/Rio/en/Parameters_(Delphi)#Constant_Parameters. I also took a wrong turn somewhere and ended up in this C++ explantion of const http://docwiki.embarcadero.com/RADStudio/Rio/en/Const in detail this sentence: "A const pointer cannot be modified, though the object to which it points can be changed." OK, so we can change the object, we are freeing it after all. But then we also change where the pointer points to, by niling it. Now that should violate the const boundary, but it does not. Is it because of the "fancy shmancy" use of @s and ^s here?
TObject(Pointer(@Obj)^) := nil;
Why? Why go to the lenghts of casting, adressing and dereferencing?
What are your thoughts and comments on this?
I think this almost cured my urge to look into the sources of other people 🤣
-
German is OK as well
I would always use indexed format specifiers though.
- 1
-
Sorry, didn't catch the subform. Can't help then.
- 1
-
We are not aware of the complete wording of said offer, that is something between Andreas and Embarcadero. What we do know from past statements however, is that some form of NDA or other contracts might be involved. But lets not speculate. IDEFixPAck will come once Andreas gets to install a 10.4 CE, which will come out with 10.4.1. So keep your fingers crossed, that this well be soon enough.
-
-
Of course you might exclude existing users. Those with 32Bit iOS. How many are there, though? What do you know about your users? Do you have any information?
However, that still wont lead to a new AppID.
-
-
On 6/19/2020 at 4:21 PM, Bernard said:I have a customer base that run windows 7 PCs with machine control software on them. These machines require periodic software updates. Some of these guys who have the machines are not technical at all. They know how to turn machuines on and off and use the machine software. Some of them have no internet so updates are sent on USB. That is why Win 7 support is a requirement.
I totally understand, but some eye candy just wont work. And sooner or later some other stuff will follow.
This discussion is as old as Windows itself. It used to be "my customers only run DOS" then became "my customers only run 16Bit Windows" over to "my customers only run WinXP" to what we have today. Someone in that story has not learned, and should be beaten with a set of Windows installation floppies: Hardware manufacturers that create one version of their controlling software and never update it, or for an ungodly price. We could break our ears and keep our software running on DOS, or just inform the customers and let them wise up and do a pitchfork and torch run on their machine manufacturer. After all, it is your hide they'll be after if something wont work because their system is outdated - not that this is the case right now.
- 3
-
Thanks for the heads up. Did you report it at QP?
-
Some files are in use while Delphi is running, so they can't be deleted. I am not sure there is any mechanism that can bypass this. Another subject for Embarcadero to look into.
-
Now that is a swift and elegant recovery from the blunder earlier. Respect @Embarcadero.
-
It's called consistency and is considered to be a good thing...most of the time.
- 6
-
On 6/16/2020 at 8:07 PM, Bernard said:Hi All,
Just got a chance to install Delphi 10.4 on my windows 7 Laptop and loaded up a sample.
I ran it and when I change the VCL style to Windows10Blue or Windows10Dark it displays incorrectly
Anyone else got this.
By the way thanks everyone for the great info on this site
Windows 7 is no longer supported, nor should it be. Why support anything even the original manufacturer only supports grudgingly and for a price? As a consequence applications will run, but eye candy will not be as sweet as intended. That seems to be a good compromise to me.
- 1
I am getting TPushServiceConection undeclared
in General Help
Posted
What do you mean "when I do this"? Do you enter those procedure stumps without interface declaration? Please check the documentation on this http://docwiki.embarcadero.com/RADStudio/Rio/en/Procedures_and_Functions_(Delphi)