Jump to content

Attila Kovacs

Members
  • Content Count

    1943
  • Joined

  • Last visited

  • Days Won

    25

Everything posted by Attila Kovacs

  1. Attila Kovacs

    UnPinnable App

    @Anders Melander yes, sorry, forgot to mention, that was under the link from @qubits, where they changed "var pps: pointer" to "out pps: IPropertyStore"
  2. Attila Kovacs

    UnPinnable App

    Ok, with the changed signature (out param) following happens: 1. try pps = nil 2. pps.IntfClear on nil 3. SHGetPropertyStoreForWindow => pps.refcount = 1 4. program run 5. finally pps.InfClear end; with var parameter, casting to pointer: 1. try pps = nil 2. SHGetPropertyStoreForWindow => pps.refcount = 1 3. program run 4. finally pps.InfClear end; 1. With my additional addref()/release() the refcount number goes up to 2 but will be released at the end in any way because pps is going out of scope (Am I right?) 2. So I'd think, because pps is a local variable, I don't need any manual intervention to its refcount and therefore I don't understand the signature change to an "out param". I mean, it could be the proper translation, it also looks better without the pointer cast, but I can't see any advantages compared to the already implemented signature.
  3. Attila Kovacs

    simple SFTP-like server for Windows?

    It's fast and it's better as rsync for my task. Thx!
  4. Attila Kovacs

    Evaluate/Modify clear history

    Any idea how can I clear the Expression and New value history? (Eventually anybody knows where the value goes from the "Expression" if you accidentally press up or down? I have a suspicion that it goes there where the light goes from the fridge after closing its door.)
  5. Attila Kovacs

    Class properties

    ok, this is weird. the "through instance reference" is just a fake, an alias to a call to the static methods. that should not exist in the language.
  6. Attila Kovacs

    Evaluate/Modify clear history

    Found it in the registry but there must be something in the IDE to clear those lists, mustn't it?
  7. Attila Kovacs

    Class properties

    because there is no instance of anything?
  8. Attila Kovacs

    Virus? How odd.

    don't use gmail for transferring exe's, there is no MTA on the world letting exe's through use defender move on
  9. Attila Kovacs

    Is a number in a string of numbers??

    You did not specify any problems, so these are coming to my mind right now.
  10. Attila Kovacs

    vtString and vtWideString & vtAnsiString

    I can't help you understand it but I'd suggest you to check the SetString() methods.
  11. Attila Kovacs

    simple SFTP-like server for Windows?

    This SyncThing is really nice, there are also QNAP packages. let's see how fast is it compared to rsync. Combined with https://www.zerotier.com/ could be a powerful combo running in the background on the NAS'es.
  12. Attila Kovacs

    PC-specific memory corruption...?

    looks like it's a UTF8 encoded string, í (0xED) is for example 0xC3 (Ã) 0xAD probably 2 times encoded that you can see the code points or because of the cast?
  13. Attila Kovacs

    PC-specific memory corruption...?

    I mean on field base. Like field varchar(10), clientcodepage utf16, can you fetch 'AAAAA' (5) but not 'AAAAAA' (6)?
  14. Attila Kovacs

    PC-specific memory corruption...?

    Why is it relevant what's in the dataset after an error in the client lib? Clear or fill the memory in zeos prior to query the db, you should see that instead of the garbage now. Also, dump the raw result to disk on both pc's and compare. One side, you were mentioning VARCHAR somewhere and the other side you are setting the clientcodepage to UTF16. I don't know oracle but this is interesting. Maybe zeos calculates for varchar and server delivers in nvarchar? Could you do some selects where the actual data is the half of the maximum data etc.. to see the threshold for the error? Btw. are the actual RDBMS's also the same? (You and your collegue)
  15. Attila Kovacs

    Remote Delphi developer position

    you just failed using a simple forum by posting this under "RTL and Delphi Object Pascal"
  16. wow, didn't know that function, have to check!!
  17. as I mentioned before, to avoid the hints you have to act so you could make it an error instead of a hint or are you the guy who having 2 kilometer of hints after a build?
  18. that won't help much as out parameter also taking inputs without any warnings, which is more screwed as the original problem
  19. A variable has to be initialized before being passed to a ref param, yes you have to decorate with "ref" or "out" -or whatever- the parameters at call: myproc(ref param1, out param2); <- this is the call, not the definition! you _have_ to set an "out" parameter before using it or before returning from the routine, even if you won't use that value (see my example) who knows what else... And I'm afraid this is because you can't just show hints for coding guidance as they will first disappear when you do what the compiler wants you to do. So it would be basically an error, like in c#. Am I right? Do we need that?
  20. but c# does not only giving hints, it is enforcing a lot of things. or is it possible to turn them off?
  21. Why is it relevant how c# works? It's completely different. won't compile: bool a(out int i) { if (1 != 2) return false; i = 43; return true; }
  22. This is more interesting to me, no hint, but I could pass values from b() to a(): procedure a(out sl: TStringList); begin showmessage(sl.text); end; procedure b; var sl: TStringList; begin //sl := TStringList.Create; //sl.Add('hi'); a(sl); end; I'd stick with "var" parameters and no superfluous hints...
  23. Why are you using "var" then? Why do you need the hint?
  24. OK, but it's not wrong passing uninitialized variable to a var parameter. Why the hint then?
  25. 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.
×