Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 09/25/19 in Posts

  1. Angus Robertson

    Best components for creating windows service apps

    DDService adds the following according to the readme: I'll put it in my SVN repository next week, Arno would be pleased, he put a lot of effort into DDService. I handle power, time and device events in my services using the normal Windows messages, wrote a hardware component that does it all. Angus
  2. Remy Lebeau

    Best components for creating windows service apps

    A Handler callback (what TService uses) can receive only the following control codes from the SCM: SERVICE_CONTROL_CONTINUE SERVICE_CONTROL_INTERROGATE SERVICE_CONTROL_NETBINDADD SERVICE_CONTROL_NETBINDDISABLE SERVICE_CONTROL_NETBINDENABLE SERVICE_CONTROL_NETBINDREMOVE SERVICE_CONTROL_PARAMCHANGE SERVICE_CONTROL_PAUSE SERVICE_CONTROL_PRESHUTDOWN SERVICE_CONTROL_SHUTDOWN SERVICE_CONTROL_STOP User-defined codes A HandlerEx callback can receive all of the above controls codes, as well as the following additional control codes: SERVICE_CONTROL_DEVICEEVENT SERVICE_CONTROL_HARDWAREPROFILECHANGE SERVICE_CONTROL_POWEREVENT SERVICE_CONTROL_SESSIONCHANGE SERVICE_CONTROL_TIMECHANGE SERVICE_CONTROL_TRIGGEREVENT SERVICE_CONTROL_USERMODEREBOOT In addition, when a service registers its HandlerEx callback, a user-defined context value can be passed to the HandlerEx whenever it is called by the SCM. That option is not available when registering a Handler callback. Also, there are newer APIs for apps to interact with the SCM, like ChangeServiceConfig2(), ControlServiceEx(), EnumServicesStatusEx(), QueryServiceConfig2(), QueryServiceStatusEx(), etc.
  3. David Heffernan

    Memory leak only with IDE debugger

    That's not right. In order to evaluate expressions the debugger needs to execute code in the target process. Which may lead to allocations. It's a defect that the IDE / debugger leak such objects, but they can't do their job if they can't execute code and perform allocations in the target process.
  4. Stefan Glienke

    DunitX / delphi-leakcheck and Rtti

    That is because internally all RTTI through an TRttiContext is handled by a singleton instance and DUnitX itself is already using some TRttiContext. So the internal singleton already exists and your usage causes it to just create more objects that are then owned by that singleton instance which outlives the unit test because DUnitX keeps it alive. This general issue of cached objects created during unit tests that keep existing after the test ran and thus are considered leaks is known and LeakCheck has mechanisms for that. Add the following line into the dpr (needs LeakCheck and LeakCheck.Utils in the uses) TLeakCheck.InstanceIgnoredProc := IgnoreRttiObjects; For more details please see the Ignoring section in the LeakCheck readme In practice there are many more places in RTL and possibly custom code that use lazy creation/caching mechanism and are subject to such a leak detection approach (see InitializeLeakCheck in Spring.TestRunner.pas for some example of such madness if you are curious)
  5. I have released version 2.3 of the SVG Control Package for parsing and rendering SVG graphics. This is a complete rewrite of the package. Among the changes are: Support for FPC Lazarus Added interfaces for more graphic libraries (Quartz, Graphics32...) Improved text rendering Faster integrated parser New licensing terms See release info over here: https://www.bverhue.nl/delphisvg/2019/09/24/svg-control-package-version-2-3.
  6. Bob Devine

    Delphi-neon, any thought?

    Just an update on this - I've been moving my persistence code (app settings, project definitions etc) from XML to JSON. So far Neon is the only library that's coped with all of my classes. I've tried maybe 6 or 7 other libraries (both commercial and open-source).
  7. Serge_G

    TListView multi selection?

    I knew I can find a better solution not involving bitmaps in the datasource . Here is the new code procedure TForm1.ListView1UpdatingObjects(const Sender: TObject; const AItem: TListViewItem; var AHandled: Boolean); var AListItemBitmap : TListItemImage; AListItemText : TListItemText; AColor : TAlphaColor; i : Word; begin AListItemBitmap:=AItem.Objects.FindObjectT<TListItemImage>('Image2'); AListItemText:=AItem.Objects.FindObjectT<TListItemText>('Text1'); if Assigned(AListItemBitmap) then begin AListItemBitmap.OwnsBitmap:=True; // this is the trick AListItemBitmap.Bitmap:=TBitmap.Create(40,40); try AColor:=StringToAlphaColor(AListItemText.Text) except // certaines couleurs sont inconnues! i.e. monneygreen, ltgrey AColor:=TAlphaColorRec.Null; end; AListItemBitmap.Bitmap.Clear(Acolor); //:=ABitmap; end; {$ENDIF} end; See line 12. Icing on the cake freeing bitmaps created is not needed anymore ! Tested on Windows10 and Android, hope it works on OSX and iOS
  8. dummzeuch

    GExperts 1.3.14 released

    The current source now compiles again with all supported Delphi versions.
  9. Put the cursor within the class and press Ctrl+Space. This will give you a list of all interface methods. Iirc this also supports multi select. Unfortunately the method declarations will always be added as public which is usually not what you want.
  10. Arnaud Bouchez

    JSON as a way to save information in Firebird

    For a regular SQL DB, I would use a BLOB SUB_TYPE TEXT field, to store the JSON content. Then duplicate some JSON fields in a dedicated stand-alone SQL field (e.g. a "id" or "name" JSON field into regular table.id or table.name fields in addition to the table.json main field), for easy query - with an index if speed is mandatory. So, start with JSON only (and a key field), then maybe add some dedicated SQL fields for easier query, if necessary. side note: I would rather use SQLite3 or PostgreSQL for efficiently storing JSON content: both have efficient built-in support. Or a "JSON native" database like MongoDB.
  11. Our laptops are under company governance, so we can't prevent the session from locking as it is dictated by the policies. In addition, the idle time is really short. So - we wrote LockBlock which basically simulates toggling the numlock every 60 seconds. That prevented the auto locking, but it also prevented the screensaver from kicking in when the dektkop was locked, so I added handling of lock/unlock to disable the fake keystrokes when it was locked. Super simple UI: 60 second interval, starting at 8 in the morning, lasting for 8 hours - with an add an extra hour button for off work hours lock blocking. Project source attached. LockBlock.zip
  12. Uwe Raabe

    Issue with code-editor toolbars

    In Tools - Options - User Interface - Editor Options - Display uncheck Show Navigation Toolbar
  13. In Editor Options - Display disable Show Navigation Toolbar
  14. Delphi is very backward when it comes to coding and refactoring support tools.
×