Jump to content


Popular Content

Showing content with the highest reputation on 11/16/20 in all areas

  1. Jim McKeeth

    Outdated Delphi Roadmap

    Coming soon to a website near you.
  2. Der schöne Günther

    Setting Scroll Bar Width problem

    I also tried something like this in the past. We dropped it, because it was a bad idea after all, even for a kiosk application like ours. Yes, it takes time. Sometimes, even other 3rd party application would completely lock up. I would strongly recommend to drop this approach. It will take a bit of work to roll your own scrollbar (for a general TWinControl, and maybe a TDBGrid), but you will end up with something that fully suits your needs and can be customized to run differently in Touch and in Desktop mode.
  3. In case someone wants to use the LibPhonenumber library from Google in Delphi. I've written a wrapper for the C # port of this library. Support for 32 bit and 64 bit. https://github.com/landrix/LibPhonenumber-for-Delphi
  4. Remy Lebeau

    How to detect if TIDMessage is unable to read an email

    TIdMessage is designed to parse RFC822-style emails only (EML files, etc). Attempting to load anything else is basically undefined behavior, there is no guarantee if/how errors will be reported back into user code. There is no single point of query where you can discover the result of a failed parse. So, your best option is to just filter out non-RFC822 files before you try to load them into TIdMessage. Basically, analyze a handful of bytes at the beginning of a given file, and if they don't appear to resemble RFC822-style headers then simply don't load the file at all (all of the non-EML file formats you have mentioned are well-documented and easily identifiable). This is something I may consider adding to TIdMessage itself in a future release, but that is not going to happen anytime soon, so I suggest you add it to your own code.
  5. We are pleased to announce Black Friday and Cyber Monday 30% discount on any of our EurekaLog products using the coupon code found below. The sale starts on a day before Black Friday (November, 26) and ends at the end of day after Cyber Monday (December, 1). Enter this code when paying for the item on our web site: BFCM2020 Existing customers with valid or expired licenses can log in and purchase upgrades, new licenses and extensions here: https://www.eurekalog.com/login.php Use the login credentials we sent you for your first purchase. If you lost or forget your password - use reset password feature.
  6. I had a similar problem decades ago with a French payment processor called "Yaskifo". Small startup which offered best prices at that time. But with wrong management of their internal costs, and which were sued by French banks at that time... Yaskifo owned me thousands of Euros, which I never saw back... Once their company was bankrupted, all customers could just weep. I don't know anything about FastSpring, but in doubt, my advice would be to switch to a bigger and safer alternative - at least joined to some well known bank or company. Even if their fee is higher.
  7. David Heffernan

    Object created in a Try block???

    try Foo := TFooBar.Create; ... finally Foo.Free; end; Consider the above. Suppose that TFooBar.Create raises an exception. In that case the finally block is executed, and `Foo.Free` is called on an uninitialised variable (Foo). That leads to undefined behaviour. So the correct pattern is Foo := TFooBar.Create; try ... finally Foo.Free; end; Here, if TFooBar.Create raises an exception, the try is never reached, and so the finally block never executes. Now another pattern was also mentioned Foo := nil; try Foo := TFooBar.Create; ... finally Foo.Free; end; This is also valid, because Foo is initialised before the try executes. And so in case of constructor exception we would call Free on a nil reference which is fine. However, this pattern is pointless and should be avoided in the scenario here where there is just a single object. It is useful sometimes if there are multiple objects and you want to avoid deep nesting. A better example of using this pattern is if the object is created conditionally: Foo := nil; try if someTest then begin Foo := TFooBar.Create; ... end; ... finally Foo.Free; end;
  8. Kas Ob.

    converting this TidBytes code To Tbytes

    Should be