Jump to content

Larry Hengen

Members
  • Content Count

    87
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Larry Hengen

  1. Larry Hengen

    FireDAC Change Notifications

    I was looking at the MS SQL sample project demonstrating FireDAC support for change notifications. Has anyone used this to refresh data-aware lookup combo boxes? What is the real world database overhead? How does it compare to polling? The sample project works fine, but I've noticed that if you launch multiple instances with a unique subscription name, only one gets notified of a change made in SSMS. Any idea why? I was hoping to use the sample app as a POC to help determine SQL Server overhead, and prove that all connected applications will receive change notifications. I am using Berlin 10.2 and the only bug reports seem to be for Rio.
  2. Larry Hengen

    Threading question

    If I am among the suspects I would have to disappoint. I agree that it is likely related to thread ownership of the string passed. That is why in old code you often see the use of a record type or short strings allocated in the calling thread and freed in the receiving thread. Like a flaming bag of dung thrown over a wall...up to the receiver to dispose of it.🤣
  3. Larry Hengen

    Threading question

    I suspect your problem is due to reentrancy. The code is using Windows messages to update to the UI only in the main VCL thread. This is a common old school approach prior to the use of TTHread.Synchronize(). I would venture the issue lies in the fact that Application.ProcessMessages is called in the message handler. As such it will attempt to process any pending messages in the message queue. When the load created by other threads is sufficient, there will be messages in the queue, and AVs will result as the stack variables will be overwritten. Take out the Application.ProcessMessages I would bet the AVs disappear. Calling Application.ProcessMessages is common when the main VCL thread may be very busy, but you want the UI controls to update to reflect progress. It is a CODE SMELL. If you see it, remove it. A background thread should be used for longer running tasks and these days there is no excuse for not using one because with the PPL, OTL or even just TThread it isn't that hard any more. In this case someone who didn't understand how the program works must have added the call to Application.ProcessMessages or thought it might help because the method call to write the log was taking so long. You might want to move the log writing to a background thread as well, and that would keep the entire processing headless, which is an excellent way to ensure it is testable with minimal dependencies.
  4. Larry Hengen

    Delphi Rio IDE hangs again and again

    Go to Tools - Options - select the Editor Options - Code Insight treeview item (at least this is the path in Berlin). You will then see the features I am referring to.
  5. Larry Hengen

    Delphi Rio IDE hangs again and again

    I would suggest turning off features one at a time to try to isolate the issue. It is very likely related to your code, but it doesn't mean the code is incorrect. Cyclic references can can cause issues. I would try disabling error insight, and turn off code insight or increase the delay and see if that helps.
  6. Larry Hengen

    Squint and read: CreateFormFromStings

    It is really discouraging to see the excuse that we can't fix it because it might break someone else's code...again and again. I would encourage the bug reporter to contest the "resolution" on such tickets and put comments I see here on those tickets. Without push back, there will be no change and I don't think the decision was made at a very high level. I bet @Marco wouldn't support that decision publicly.
  7. Larry Hengen

    Interface Completion

    When re-factoring code so I can introduce an interface I need to have properties implemented on the interface for compatibility to the existing implementation, so I need setters and getters to be implemented. I f I copy all the property declarations from the existing class and change the Field references to Get/Set methods, I would like to have the Delphi IDE generate the Get/Set methods the same way class completion does so for classes. Is there a way in the Delphi IDE to get Interface declarations "completed" IOW the method declarations generated in the interface? Here is some sample code to illustrate the issue: ICRSAMClient = interface(IInterface) ['{FF3CA485-A0CA-4ED6-8D70-9A757E8E9E0E}'] //property Getters/Setters function GetCRSAMData :TCRSAMDataArray; procedure SetCRSAMData(Value: TCRSAMDataArray); function GetCRSAMDataCount :integer; procedure SetCRSAMDataCount(const Value: integer); function Q22Search(Param: TCRSAMSearchParam; Threshold, RowLimit: double): boolean; property UserId: string read GetUserID write SetUserID; // User ID (authorization) property UserFirstName: string read GetUserFirstName write SetUserFirstName; // User First Name (authorization) property UserLastName: string read GetUserLastName write SetUserLastName; // User Last Name (authorization) property SendingApplication: string read GetSendingApplication write SetSendingApplication; // property SendingFacility: string read GetSendingFacility write SetSendingFacility; // property ProcessingID: string read GetProcessingID write SetProcessingID; // property Data: TCRSAMDataArray read GetCRSAMData write SetCRSAMData; // CRS returned data structure property DataCount: integer read GetCRSAMDataCount write SetCRSAMDataCount; // Data structure object count end;
  8. Larry Hengen

    Interface Completion

    @Jason Smartmuchas gracias!
  9. Larry Hengen

    Interface Completion

    @Jason Smart That is a great approach. Care to share your templates?
  10. Larry Hengen

    Interface Completion

    Yes that is exactly what I am asking. I too have traditionally used class completion on the class and then copied the Getter/Setters to the interface, but ideally the IDE limitations should not prevent you from working the way you wish too, it should facilitate most use cases. You should not have to implement an interface on a class in order to define the interface.
  11. Larry Hengen

    New free firebird tool... (Didn't make it ;) )

    I have 64 bit Firebird installed but I did not generate the GDS dll as I am using FBClient.dll.
  12. Larry Hengen

    New free firebird tool... (Didn't make it ;) )

    Well I have been using FlameRobin which is cross platform, but has some issues and is apparently no longer under active development. I thought I would try out this utility, but I downloaded the Win64 Zip package, expanded it into a folder and launched it.....BOOM...AV before the main GUI appeared.
  13. Larry Hengen

    Tool to fix up uses clause unit namespaces?

    I believe the GExperts Uses Clause manager will remove or add unit prefixes, just not sure if you can automate that without extracting the pertinent code from their repo and fashioning a tool. Perhaps macros with the UCM?
  14. Larry Hengen

    Thinfinity VirtualUI - cloud-based conversion

    I downloaded and tried a development version and it was as advertised. I think I had to change 1 line of code and voila....a browser based version. That said, if you do some things like host an ActiveX, or WPF control in your app then it's not quite so straightforward. For a smaller application it is certainly a solution that beats redevelopment as a web app. I don't think hosting a large app is a good long term solution due to the server resources required, but it's certainly worth some investigation.
  15. Anyone ever printed charts that are segmented to fit each page with a legend? Client wants PDF output with multiple graphs vertically on the page with a user defined horizontal extent (ie: 50 metres) of each graph appearing on each page with a legend beside it. Not quite the same problem as just printing an oversize image. Any recommendations on approach or tools for Delphi?
  16. Larry Hengen

    Printing Multiple Charts that Span Pages

    Thanks for the feedback. I would probably opt for Gnostice PDF Toolkit rather than using ReportBuilder with Gnostice's ppDevice implementations because if there is any issue one vendor might just point the finger at the other and it makes it more difficult to isolate the cause.
  17. Larry Hengen

    Printing Multiple Charts that Span Pages

    @Geowink, I actually bought RAVE at BorCon back in the day, but abandoned using it around the time they were no longer bundled with Delphi and support dried up. I didn't know they were still in business, but that experience kind of soured me on them. I was looking at Gnostice PDF Toolkit as a potential solution. @Attila Kovacs Interesting component suite.I can see that being a great solution for server side web projects.
  18. Larry Hengen

    Printing Multiple Charts that Span Pages

    I also had issue in the past using different ppDevices to render PDF. The PDF text and images were sometimes blurry. Any advice hot to address that?
  19. Larry Hengen

    Printing Multiple Charts that Span Pages

    I am currently not using a reporting tool but I have used ReportBuilder in the past. It is one of my more favorite report writing tools, but I was not aware that it would provide the functionality I desire for this use case. Do you use it to print an image of the chart? If that is the case then would you not still have to determine the image resolution to use, and where to segment it so it would fit on a page with the legend?
  20. Larry Hengen

    InterBase or Firebird?

    I would only use SQLLite for smaller mobile projects. I have found that Firebird 3.04 performance is much better than SQLLite on my laptop and it has a richer set of data types and more features.
  21. Please forgive the question if it's seems obvious. I have always Implemented an interface in a new class the hard way in Delphi by copying the interface members from the interface into the class and using class completion to generate the methods. Is there a way to do so in the Delphi IDE without such a manual brute force technique? I don't see anything in the Refactor menu and invoking Class Completion on a class with an unimplemented interface does nothing. Is this only possible through a third party IDE add-in like MMX? I would think that in the age of interface based development, making it easy to define and implement interfaces would be a well supported use case within the IDE, so I am assuming I just don't know of it. It's a snap in Visual Studio.
  22. Larry Hengen

    Changes in Parallel Library

    I agree with that assessment. I would use the OmniThread Library before the PPL or roll my own threads.
  23. Larry Hengen

    How best to update from 10.3.1 to 10.3.2?

    The answers to your questions would be 'ask Embarcadero', and 'Embarcadero'. It is really pointless to ask such questions here. I have advocated for an in-place upgrade mechanism for a long time now. The response I received from Marco IIRC, is that it was under consideration but was a very complex issue to address because the product is so big and involves third party components. There are lots of similar products that have AutoUpdate functionality so I don't think this is an insurmountable problem, but EMBT has other more important issues to deal with such as keeping the frameworks and compiler tool chains up to date with an accelerating pace of change on all the supported platforms. They didn't have time to bring FMX to Linux, so they acquired it from KSDev. As with any 25+ year old product, there is also technical debt to address.
  24. Larry Hengen

    Left Click Does not Focus Control

    I have a TForm descendant that contains a scrollbox, and the form is nested within two panels on the main form of my application. It displays values in a manner similar to the object inspector, and the user needs to be able to edit the values. For some reason, I cannot focus the TLabeledEdit controls using the mouse left button click. Right clicking on the control works and selects all text in the TEdit, but left click does not. I see that a WM_SETFOCUS message is sent, but false is returned. Before I start digging into the the VCL's message handling, I was wondering if anyone might know the cause of such behaviour, or have suggestions on how to best track it down. I just converted the "inspector" form to a TFrame. In doing so I loose some functionality like the ability to close the form, but I can now focus the edit control using the left mouse button, and I also get a right click local menu for the editor. Is there anyway to make the embedded form behave in the same way as the frame with respect to embedded controls?
  25. Larry Hengen

    Left Click Does not Focus Control

    Thanks for the answer. It's always nice to know why. Actually the Caption bar is one of the things I liked about using embedded forms, that and the OnCreate/OnClose events. I have switched things to use TFrame descendants, which works reasonably well, but I had to introduce my own caption bar and deal with the lack of the events I mentioned.
×