Jump to content

John Kouraklis

Members
  • Content Count

    319
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by John Kouraklis

  1. Hi, I've got a class and it has a property TDictionary<..,..>. I want to use RTTI to access the key and value of the dictionary. I am able to get the property but I can't figure out how to access the key and values. I use this approach: var genericDictionary: TDictionary<TKey, TValue>; propValue: TValue; ... propvalue.ExtractRawDataNoCopy(@genericDictionary); ---> Here I can see in the debugger that genericDictionary has the items and the correct count Then, I get AV when I try to iterate the Keys because TKey is an abstract class. Anyone can help? Thanks
  2. John Kouraklis

    Developer Express gave up on FMX

    I don't think when EMBA bought the very first version of FMX mobile OSs where that dominant as they are today. I feel they were mostly trying to enter macOS world
  3. John Kouraklis

    Waiting for multiple threads

    Hi, I've got an app that launches a few threads. Each thread does different things but they all write in the same log file. Some threads check the internet too. Everything works well in the normal course of the application. The problem I have is when the user tries to shut down the app. What happens is that those threads that are attempting a web query or are writing in the log file raise an AV complaining that another process is attempting to write the log file. The writing process to log file is thread-safe for sure. Then, I created a global var to indicate the background running tasks. I use Atomic Inc/Dec to change the value and in FormCloseQuery I am waiting for the value to get to zero before the form is allowed to close. But the problem with the log file still appears. What's the strategy to shut down a multi-thread app? I also contemplated the idea of having another global var to indicate that the app is shutting down and then exit from the threads but this will pollute the code and it does not feel right.
  4. John Kouraklis

    Waiting for multiple threads

    @Kas Ob.Thanks for the detailed example. I have a class that manages all the thread so it was easy to keep track of TEvent for each threads as they are not scattered everywhere in the code. I haven't looked at the ability to cancel the thread yet. I think @Vincent Parrett's approach looks interesting
  5. John Kouraklis

    Profiler for Delphi

    I tried NQS for a while. The UI is very confusing to me. It is 80s but I don't mind that much; what I don't get is how you load the projects and profile them. Even when you launch it from inside Delphi, it doesn't work smoothly. I found it very cumbersome. The only other reliable and affordable solution I found is ProDelphi. I haven't tried the x64 version but the x32 works nicely. The only downside is that it alters the source code during what they call instrumentation. But it cleans the sources after that perfectly. And they are very responsive with support.
  6. John Kouraklis

    Waiting for multiple threads

    I use just a boolean flag but this seems more flexible and proper. I'll try it. Thanks
  7. John Kouraklis

    Waiting for multiple threads

    Thanks for the suggestions. I created an array of TEvents and each event is passed to each thread. Then the TEvent.WaitFor...... method seems to do the job perfectly well.
  8. John Kouraklis

    Developer Express gave up on FMX

    Unless you have only Win apps and things like Win utils, FMX or more correctly cross-platform is the only way to go. The landscape in the market is vastly and rapidly changing and more platforms appear every other day. Unless you are an established large company, you can not afford to miss the opportunity of jumping into new markets quickly and with limited resources. We should not judge FMX's state and value based on what DevExpress says. I think their decision is more of a business one rather than a technical. Their clients are VCL develops and to me it is not a surprise that not many of them have adopted FMX. In fact, it is surprising they concluded there is no market for them. To me it seems very short-sighted understanding of the market. I am sure if they insisted, in 2-3 years their evaluation would be different. And I am also pretty sure when they started with the VCL suite, they had to iron out bugs, etc. But back then they were not the company they are now. Having said this, I have to mention here that I am not pleased with the way EMBA sees FMX either. I understand that most of Delphi clients are largely VLC developers. On the other hand, EMBA promotes Delphi as the one code base cross platform dev tool and yet they mostly focus on the introduction of new VLC products. This is a mess with their strategic priorities and every time I attend the webinars for new releases, I am disappointed to see they continue with the same approach. For example, they introduced a new TNumberBox---why is this not a FMX and VLC compoent? or the Control list?
  9. John Kouraklis

    Blogged : Advice for Delphi library authors

    Pascal Analyser is more thorough I think
  10. John Kouraklis

    Blogged : Advice for Delphi library authors

    Sometimes I am speechless when I hear the way some people in EMBA respond to questions. They have a degree of naivety that makes you think they are talking about a product from another company😏
  11. John Kouraklis

    Delphi 10.4.2 first impressions

    How about 10.4.0?
  12. John Kouraklis

    Delphi 10.4.2 first impressions

    Yes, but the DCUs between 10.4.0 and 10.4.1 are not
  13. John Kouraklis

    Delphi 10.4.2 first impressions

    Quick Questions: 1. Why do we need the Migration Tool? This is a minor upgrade. If I don' use it, will the settings be lost? 2. Yesterday in the webinar, it was mentioned that the binaries should be compatible with 10.4.2. However, the binaries from 10.4.0 are not compatible with 10.4.1.
  14. John Kouraklis

    Why is TList freed in this code?

    Hi, I've got difficulties figuring out what is wrong with the following code: program Project1; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, System.Generics.Collections; var dic: TObjectDictionary<string, TList<string>>; list: TList<string>; begin try dic:=TObjectDictionary<string, TList<string>>.Create([doOwnsValues]); list:=TList<string>.Create; list.Add('111'); dic.AddOrSetValue('aaa', list); var gg: integer:=dic.Items['aaa'].Count; writeln(gg); // 1 var l2: TList<string>:=dic.Items['aaa']; var a:integer:=l2.Count; writeln(a); // 1 l2.Add('222'); a:=l2.Count; writeln(a); // 2 dic.Items['aaa']:=l2; a:=l2.Count; writeln(a); // 0??? a:=dic.Items['aaa'].count; writeln(a); // 0??? dic.Free; // Invalid point? readln; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end. When I assign the TList to the dictionary Value, it loses all the elements. What am I doing wrong here? Can't see what is going on. Thanks
  15. John Kouraklis

    Why is TList freed in this code?

    Oh, good to know it honors its name
  16. John Kouraklis

    Why is TList freed in this code?

    So, how does it behave? never used it
  17. John Kouraklis

    Why is TList freed in this code?

    So, the doOwnsValues frees the objects in assignments as well. I thought it only takes care of them when the dictionary is freed. Thanks a lot guys
  18. John Kouraklis

    FMX TWebBrowser Security Error

    I use TWebBrowser and trying to login to an email account. After the initial page, I get an error saying that "The browser or app may be insecure. Try using different browser". Does anyone know how to fix it? I read on the net that I can change the User Agent header to reflect a newer browser but couldn't find how to change the header in the component. Thanks
  19. John Kouraklis

    How to implement Push Notifications?

    Hi, I want to implement push notifications in a desktop app for GMail. I have read the dev guides and looked it up on the web and I all tutorials talk about how to do it in web apps. My email client on Android uses push notifications. Can anyone guide me on this? Or, any demo apps, perhaps? Thanks
  20. John Kouraklis

    ANN: Better Translation Manager released

    Yes, I was sure that other platforms wouldn't be easy to work with. Thanks for the tips.
  21. John Kouraklis

    ANN: Better Translation Manager released

    HI, Thanks a great app. Thanks for the contribution. I've got two questions: 1. Does the translation work in FMX apps? 2. Is there a way to load a resource file at run-time without the need to restart the translated app? Thanks
  22. Hi all, I'd like to share that my new book is almost out. Apress is working hard to put it in the market. We always discuss how we can bring new people to Delphi so I thought it would be a good idea to ease their way in by providing a quick up-to-date guide on the basics of the language. The book covers new features introduced in 10.4 Of course, a reference book is always useful to experienced coders as well; we all need a refresher every now and then 🙂 I would like to cordially thank Dr. Holger Flick for reviewing the chapters; his experienced view guided me during the writing of the book. Regards, John 9781484261118.tif
  23. John Kouraklis

    Are we just "Cash Cows"?

    In my view, the problem with Emba in relation to Delphi (and perhaps to C++ Builder) is not a problem of resourcing and funding. It is mainly a problem of mindset
  24. John Kouraklis

    Book: Delphi Quick Syntax Reference

    Apart from the additions in 10.3 and 10.4 I found very difficult to track down and verify this information and then to present everything in a concise way. And I am not sure a newcomer would really find this useful. Perhaps if you write components and need to cover old versions this would be useful but I feel this is a bit out of the scope of the book.
  25. John Kouraklis

    Book: Delphi Quick Syntax Reference

    I can't insert an image in the post now. So here's a link https://www.amazon.co.uk/Delphi-Quick-Syntax-Reference-Language/dp/1484261119
×