Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Clément

  1. Clément

    TBitmap32 to jpg (graphics32)

    I'm using since Delphi XE Should be in VCL.Graphics unit.
  2. Clément

    Out Of memory

    You're probably hitting 32 bit application address space limit. One easy way to check this is to open Task Manager and monitor you application when executing that specific lines of code. *IF* this is the problem, then you are downloading too much data, and the "Out of memory" will happen in whatever unit asks for memory and don't get it. FireDAC has some Fetching options, and my guess is you're using FetchAll. You might want to try fmOnDemand. " FireDAC is fetching rowsets according to the FetchOptions.Mode property: fmOnDemand--the rowset is automatically fetched when the dataset is trying to move the current position beyond the last fetched record. fmAll--all the rowsets are automatically fetched right after executing the SQL command. This is similar to calling the FetchAll method. fmManual--the programmer manually fetches the rowsets using the FetchNext or FetchAll methods. fmExactRecsMax--all rowsets are automatically fetched right after executing the SQL command. If the number of rows is different from FetchOptions.RecsMax, an exception is raised. " https://docwiki.embarcadero.com/RADStudio/Sydney/en/Fetching_Rows_(FireDAC) You are seeing the message only once most probably because FireDAC exception handler is freeing the memory allowing you application to work with whatever memory is available. HTH
  3. Clément

    TBitmap32 to jpg (graphics32)

    Sorry if this is not related to your problem, but have you tried using TWICImage ?
  4. Clément

    Do you need an ARM64 compiler for Windows?

    Till in DevExpress front: https://community.devexpress.com/blogs/vcl/archive/2022/07/25/vcl-subscription-upcoming-features.aspx " In this blog post, I'll summarize new VCL features we expect to ship in mid to late August. As always, thank you for your continued support." Might not be the roadmap, but they are working.
  5. Clément

    Project manager feature

    Hi, I was wondering if there's a feature (or plugin) that would allow me to right click a folder and add a new unit direct in that folder. For example: When I right-click "task.code" folder, I would like the context menu to display two new options "add new unit" and "add new existing unit". When selecting "add new unit", "Unit1.pas" would be created under "task.code" allowing me to renaming that unit directly and start working on it. Do you know if there's such a tool? I'm using D11.1 TIA, Clément
  6. Clément

    Project manager feature

    Right-clicking on the project is what I do. Including the dragging part. This is a time saver. On the other hand working on bigger projects, right clicking on a folder and beeing able to add a new unit to the correct place would be great too. I googled for some tools for that, but found nothing. I'm working on a plugin to add "New unit" and "Add existing" to the context menu at the folder level.
  7. They are debating the age rating for the video. Things went pretty wild yesterday.... "I want to Free this"... "you can't, the fabric of spacetime will collapse if you write code this way".."but, spacetime is thread-safe" .. "No!" Well... I hope the link will be available soon. I want to see some parts in slow motion.
  8. Since this is such sensitive debate, better set some base rules: no pulling hair no poking the eye no dropping hot coffee over the speaker desktop no high kick no low kick no wedgie let's try to keep this debate civilized
  9. I wrote a old listener derived from TThread, and I'm using Suspend/Resume when +100 connections are made. The code is simple : if (FThreadCount > _MAX_THREADS) and Assigned(FListener) then FListener.Suspend; if (FThreadCount < _MAX_THREADS) and Assigned(FListener) then FListener.Resume; The compiler is complaining both methods are deprecated. So... should I ignore the warning (W1000) or use a different approach to limit the connections? What would that be? Thanks
  10. Oh. Now See! I'll study the Semaphore implementation
  11. I'm looking for something like this... https://docs.microsoft.com/en-us/windows/win32/procthread/suspending-thread-execution "A thread can suspend and resume the execution of another thread. While a thread is suspended, it is not scheduled for time on the processor. If a thread is created in a suspended state (with the CREATE_SUSPENDED flag), it does not begin to execute until another thread calls the ResumeThread function with a handle to the suspended thread."
  12. Clément

    Delphi 11.1 is available

    Just installed 11.1! The installation ran smoothly ( uninstalling / reinstalling ) I used Web Installer. I compiled a few projects successfully. I really want to test the debugger! 11.0 was driving me nuts!!
  13. Have you received the "What's coming in RAD Studio" webinar? Having to answer to everyone is very time consuming, repetitive and unproductive task. Maybe it's easier for Emb to address the public from a single place: The Webinar. Hopefully they will tell us what's going on and what they are planning to do (Wiki, roadmap, next update, etc... ) Read more
  14. For a good solution you must work both ends. The application, the device and the connection between them can crash, this is why is very important to be able to query the device! From your application: 1. Write down some identification ( file, table record, etc) 2. Send the data 3. Store the answer ( delete the file, update record status etc) From the fiscal printer, in case of a crash you need to query the ID you sent: a. If file exists or record is in open state then read the ID and query the device for that ID status b. If data was not sent, the device will return with an error, in this case pick up from step 2 c. if data was sent, the device should answer properly, in this case start from step 3 If you can't query the device, you will get a half baked solution to your problem.
  15. Clément

    DocWiki.Embarcadero.com does Russian Roulette.

    It's tradition. Since newsgroup days Somebody shutdown THE server that could never be shutdown...
  16. Hello, I'm using D11 I need to create a custom highlighter with the following properties: * VariableList * FunctionList: must have () (open and close parenthesis) * Literals * constants Variables: SomeString, SomeInteger, SomeDouble should be highlighted as variable if they are in VariableList Functions: DateFormat( param1, param2 ), Date() should be highlighted as functions only when the '(' is typed; The following expression should be display like: c:\temp\DateFormat(Date(),"yyyy_mm_dd") and c:\temp\DateFormat( Date, "yyyy_mm_dd") // here Date is a variable I found some old code in the internet for older versions/branches of TSynEdit. I'm using the latest from Getit! Is there any example somewhere? Thanks
  17. Clément

    Interface question

    Why don't you use the TListView in Virtual mode (OwnerData := True)? Use the OnData event with Item.Index as your index and use an objectList like TStudentList = TObjectList<TStudent>; get the data from this list, for example: procedure TForm1.ListView1Data(Sender: TObject; Item: TListItem); begin var lStudent := glbStudentList[ Item.Index ]; Item.Caption := lStudent.Name; Item.Subitems.Add(''); // lStudent.Score1 ? Item.Subitems.Add(''); // lStudent.Score2 ? Item.Subitems.Add(''); // lStudent.Score3 ? Item.Subitems.Add(''); // Total ? end; Remember to "feed" your listview using the count property: MyListVview.Items.Count := glbStudentList.Count; This assignment is required everytime you add or remove a student from the list.
  18. Have you tried: TBook = Class End; TNote = Class End; TBooks = TObjectList<TBook>; TNotes = TObjectList<TNote>; TSerializeJSON<T : class> = Class private public function ToJSON<T : Class>( aList : TObjectList<T> ) : String; End; And call it : procedure TForm56.FormCreate(Sender: TObject); var lNotes : TNotes; S : TSerializeJSON<TNote>; begin S := TSerializeJSON<TNote>.Create; Memo.Lines.text := S.ToJSON<TNote>(lNotes); end; This is just to give you an idea. I just compiled and posted
  19. Have you tried to use val ? ex: val('1287653.3', yourFloat , InvalidCharIndex ); Val converts a string to a numeric value. The Result argument can be an integer, Int64, or floating-point variable. If the conversion is successful, InvalidCharIndex is zero. Otherwise, the value of InvalidCharIndex is the string position where Val first detected a format error. Val is not a real procedure.
  20. Hello, This suite is designed to keep devices online during active hours and optionally turn them off, both manually or automatically. The client app can configure each devices properties like hostname, MAC address, active hours, shutdown hours and allows to wake-up or shutdown several devices when needed with a button click. In case of an emergency, you can shutdown all devices. If the service is installed and running, each device will be checked and woke-up (or shutdown) automatically using the active hours and shutdown hours. NB: You must configure WOL properly in your OS and BIOS! You can check it out at https://www.dhs.com.br/dhsWOLSuite.html It's free! Save up energy! Don't keep machines up and running if they aren't required. Save the Planet!
  21. Hello, I'm using Delphi 10.4.2 with Firedac against SQL Server northwind database. I setup the components to execute asynchronously and assigned the OnError event. But the out of memory is not cached and I don't have a clue on how/where to catch it I'm running this query "select * from categories, orders, employees" to simulate the error a user is reporting. The application (32 bit version) memory goes to 1.7Gb and raises the out or memory. The problem is not the query per se, I'm just trying to catch the out of memory error. Here's some code: function TSQLTaskWorker.DoCreateQry(const aSQL: String; aFDConnection: TFDConnection): TFDQuery; begin Result := TFDQuery.Create(nil); if Assigned(aFDConnection) then Result.Connection := aFDConnection else Result.Connection := fFDConnection; Result.FetchOptions.Mode := fmAll; Result.FetchOptions.Items :=[fiBlobs]; Result.FetchOptions.Cache :=[fiBlobs]; Result.FetchOptions.AutoFetchAll := afAll; Result.FetchOptions.RecsMax := 100000; Result.SQL.Text := aSQL; end; procedure TSQLTaskWorker.DoSetConnection(aTaskConnection: TSQLTaskConnection); begin { ... Setting up fFDConnection ... } fQryAsync:= DoCreateQry('', fFDConnection ); fQryAsync.ResourceOptions.CmdExecMode := amAsync; fQryAsync.AfterOpen := event_QueryAsyncAfterOpen; fQryAsync.AfterExecute := event_QueryAsyncAfterExecute; fQryAsync.OnError := event_QueryAsyncError; end; procedure TSQLTaskWorker.DoRunSQLAsync(aSQLTaskRequest: TSQLTaskQueryRequest); begin fQryAsync.SQL.Text := aSQLTaskRequest.SQL; fQryAsync.Tag := NativeUInt( lTaskAsyncQueryResponse ); fQryAsync.OpenOrExecute; end; When DoRunSQLAsync is called, fQryAsync.OpenOrExecute is called and returns immediately as expected. I can follow the memory building up until the out of memory is raised. The error is raise before calling any events, and afterward no event is called either. I can't find a way to trap such error. Here's the call stack: Since I'm not able to handle properly this error, my application becomes unstable and must be closed. Any ideas? Clément
  22. I've been testing Delphi 11 with small projects, just because their are simply to migrate and test. Although most features are working fine, some bug are very annoying and counter productive. 1) Code refactor: Is not working fine. There are methods (or classes) that kept the old name. For example, I'm renaming a class with several methods. Only part of them gets renamed in the same unit. Nothing happens with external references. I have to check manually or "Compile and Fix" the bad refactored code. 2) LSP: It's hard to describe. There's clearly an improvement but something got broken in the way. Lot's of curly lines are shown where code is fine. I have to close/reopen the IDE. If I refactor a method name for example, The new name will get red curly lines. After adding units or refactorying code, there are so many curly line is hard to pin point what is correct and what's not. Once the project compiles, I have to restart the IDE for those curly lines to disappear. 3) Delphi 11 Help need some help.. again 😞 4) When debugging Inline var the wrong value is displayed but the routine works as expected, i.e, the value is correct. 5) Incremental searching components (component palette) is very slow. Someone forget to use BeginUpdate/EndUpdate? 6) When closing the IDE there's this error that pop's once in a while. The projects I'm working are very simple, and I'm using valina components from the IDE ( TControlList, TControlListButton, SVG Images from ethea, ICS ), in fact the same components/source code are shared with 10.4.2 (which is working fine) On the other way... 1) Delphi 11 generates faster and smaller code. 2) The IDE design is the best, snappier, no more flicking, and very fast! I really enjoy working with it 3) The class helpers for TDatetime and currency are great! 4) the debugger improved a lot and displays correctly (most of the time) generics and complex structures, both in 32 and 64 bits. 5) Getit is great! I will continue migrating my small projects to Delphi 11, but I will wait for a patch before considering Delphi 11 as my main IDE.
  23. Clément

    TFDQuery Async execution aborts with out of memory

    Good news! I'm calling TFDConnection.AbortJob from an instance in the main thread, and it is aborting the query running in another thread! How cool is that! Also I manage to catch the out of memory error in my default Query execution flow! The application remains stable even after the out of memory
  24. Clément

    TFDQuery Async execution aborts with out of memory

    I will try to call AbortJob from the main thread. My TFDConnection is in another thread, so it should work.
  25. Clément

    TFDQuery Async execution aborts with out of memory

    This is my "cKwel" query tool available for free in 32bit and 64bits. The user downloaded the 32bit version because he is using 32bit library to connect to his database.🤨 The SQL Query is already running in it's background thread. FireDAC accepts the following Execution modes: amBlocking The calling thread and GUI are blocked until an action is finished. amNonBlocking The calling thread is blocked until an action is finished. The GUI is not blocked. amCancelDialog The calling thread and GUI are blocked until an action is finished. FireDAC shows a dialog, allowing to cancel an action. amAsync The calling thread and GUI are not blocked. The called method returns immediately. TFDQuery is created using amBlocking. In this mode, just placing TFDquery.Open in an exception block solves the problem. But, in this mode the user have to wait until the end of the execution and there's no way to Cancel the query (calling abortJob) Since I'm already in a background thread, amNonBlocking and amCancelDialog are not an option. Which leaves me with amAsync. The "Cancel Query" button is working. But I can't catch the out of memory error, and who knows what other exceptions?