Jump to content

eivindbakkestuen

Members
  • Content Count

    106
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by eivindbakkestuen

  1. eivindbakkestuen

    rare unrepeatable memory errors

    If your application has bugs, sure...
  2. eivindbakkestuen

    tag as String

    What problem are you trying to solve?
  3. Using the WrapDelphi and associated classes, I have probably missed it, but I couldn't see an equivalent to the CreateComponent() method to create non-TComponent descendant classes, eg TStringList etc which I needed for things in the .PY script below. Is there an existing way of creating such classes on the fly in the .PY script? ... db = CreateComponent("TnxDatabase", None) sl = TStringList (?) db.GetTableList(sl) print(*sl) ... I added the following method and registered it, and now I can do sl = CreateClass("TStringList", None) and it works. If there's no such built in method, feel free to assimilate this method into the WrapDelphi unit. πŸ™‚ function TPyDelphiWrapper.CreateClass(pself, args: PPyObject): PPyObject; // Exposed function at the Module level // CreateClass(ClassName, Owner) var KlassName : PAnsiChar; _obj : PPyObject; Klass : TClass; _comp : TObject; TheClass : TObject; Ownership : TObjectOwnership; begin Result := nil; CheckEngine; with Engine do begin if PyArg_ParseTuple( args, 'sO:CreateDelphiClass', @KlassName, @_obj ) <> 0 then begin try Klass := GetClass(string(KlassName)); except Klass := nil; end; if (Klass = nil) or not Klass.InheritsFrom(TObject) then begin PyErr_SetString(PyExc_TypeError^, PAnsiChar(EncodeString( Format(rs_ErrInvalidArgs, ['CreateClass', rs_InvalidClass])))); Exit; end; TheClass := TClass(Klass).Create; Ownership := soOwned; Result := Self.Wrap(TheClass, Ownership); end else PyErr_SetString(PyExc_TypeError^, PAnsiChar(EncodeString( Format(rs_ErrInvalidArgs, ['CreateClass', ''])))); end; end;
  4. eivindbakkestuen

    How to release memory used by exceptions?

    I'm using the WrapDelphi unit in a project, so that the TPyDelphiWrapper.CreateComponent function can be available from a Python script. Now, a clever user has come up with a "smart" way of finding available classes; namely, iterate over every possible string of characters and feed the strings into CreateComponent() in the Python script, and catch exceptions raised when the classname doesn't exist. Yes, due to the exponential nature of the search as the strings get longer, its not really a good way of finding long classnames. However, the problem I'm being presented with is that memory runs out long before time does. I have narrowed the problem down to the following (commented out by me for test) PyErr_SetObject call in TPyDelphiWrapper.CreateComponent(). if (Klass = nil) or not Klass.InheritsFrom(TComponent) then begin // PyErr_SetObject(PyExc_TypeError^, PyUnicodeFromString( // Format(rs_ErrInvalidArgs, // ['CreateComponent', rs_InvalidClass]))); Exit; end; The inner function in the Python script is the following. My question is, is there something different that needs to be called from the Python script, in order to release memory used by the exception? def typename(k, prefix="T", ab=alphabet): try: w = prefix + int2word(k, ab=ab) t = CreateComponent(w, None) out = ["T" + type(t).__name__] t.Free() del t except: out = [] return out
  5. eivindbakkestuen

    How to release memory used by exceptions?

    Thanks a million! With the latest version, I no longer see the memory leak.
  6. Having just installed Delphi 12.2, I'm seeing something I've not seen before. I have the grep results panel docked on the right with the project manager etc; somehow it is now displaying content matching the form designer, or the source editor, switching with each F12 press. Anyone else seen anything like this? I'm not sure exactly what I did to trigger it, and it didn't happen again after restarting the IDE.
  7. eivindbakkestuen

    Datafaction = DaAbort still shows the error message?

    Notice the "Post" part? I'm guessing the error doesn't occur in .Post, but in .Edit.
  8. I'm playing around with Demo31, its very neat that we can do things like this in the .py script: mytestform = CreateComponent("TForm", None) mytestform.Caption = 'Hello Delphi-PRAXIS' mytestform.Height = 1000 mytestform.ShowModal() However, it would be even cooler if it was possible to use the Pascal style of creation: mytestform = TForm.Create() Unfortunately, playing around with the DelphilWrapper classes hasn't lead to anything working; I've tried things like these PyDelphiWrapper.RegisterDelphiWrapper(TPyClassWrapper<TForm>).Initialize; ...or... PyDelphiWrapper.WrapClass(TForm); Is there any way of registering Delphi classes, such that the someclass.Create() syntax would work in a .py script?
  9. eivindbakkestuen

    TComponent.Create() equivalent in Python script?

    Ok, thanks!
  10. eivindbakkestuen

    DElphi XE 10 FireDac

    There is no such version...
  11. eivindbakkestuen

    How to check for Delphi update?

    This is actually wrong or at least misleading; you should *not* uninstall manually before installing an update to a major version! Instead, you should let the new installer do the uninstall of the old version (it does this as part of the install), and don't change the default "not" setting in the dialog that asks you if you wish to remove registry settings.
  12. eivindbakkestuen

    VCL - Canvas does not allow drawing

    Looks VCL themes related. What Delphi version? Reproducible in a simple test app?
  13. eivindbakkestuen

    I'm on the Dark Side... no, really!

    Kudos on the just released update for Delphi 12, much appreciated! I have seen a previous reply from the dev that support for dark themes are not going to be done. Their choice of course, I understand. Regardless, I'm throwing my vote in for a change eventually. πŸ˜„ Imagine that you're running Delphi in Dark mode... on a really good size monitor... (55" in this case) It looks pretty good, except for the GExpert Grep results, which in contrast to the rest of the IDE, now tries to fry my retinas. LOL Anyway... Seriously, if there's any way a volunteer could help with this... I'd put my hand up.
  14. eivindbakkestuen

    I'm on the Dark Side... no, really!

    There is no one size fits all answer; for some people light mode is best, for some, dark. With bated breath... πŸ˜„
  15. eivindbakkestuen

    import C# Dll in delphi 10.4

    Use C# to create an intermediate DLL that loads the existing DLL, and exports the methods you need on the Delphi side, using types and calling conventions compatible with Delphi.
  16. https://forums.adug.org.au/t/adug-2024-symposium/60264 ADUG is excited to announce our 2024 Annual Symposium will be held on 17th May 2024. Save time - Details and Registration web page here for 2024 ADUG Symposium 1 Join us for the day and expand your knowledge of the Delphi ecosystem. Four speakers will present on different areas of interest. Topics range from building web applications, understanding security challenges and how to meet them, keeping code relevant over the long term, to new directions in the FastReports’ world. β€’ Tim Young gives us a tour of Elevate Web Builder. Build both your client and server web application quickly and easily using the familiar techniques we use in Delphi. β€’ Alister Christie shares practical strategies to bolster the security of Delphi applications. Join us for an illuminating session as we explore the challenges and strategies to fortify your Delphi applications against the ever-changing landscape of security threats. β€’ Mark Fletcher shows us how 2 million lines of code from the 1990s has been kept relevant into the 2020s. His team has navigated from an outright purchase model to SAAS, moved from a single retail channel vertical focus to a 16-channel β€˜vertical’ focus and embraced integrations to lean into change. β€’ Michael Philippenko takes us through a brief review of the latest developments in FastReports, followed by discussion of support of the latest standards for displays, documents (bar-codes and PDF signification), multithreading in printing, and HTML and PDF two-side integration. This ADUG symposium is being held in Melbourne and streamed online. For those in Melbourne, come to The Bridge Mordialloc for a full day of talks, refreshments, lunch and the famous prize draw at the end of the sessions. There is a separate bistro dinner at the venue for those who wish to spend more time catching up with old friends and making new ones. For those outside Melbourne, the day is streamed. If you live in a time zone that makes viewing all sessions difficult, recordings of sessions will be available to registered attendees. Make the most of the opportunity to hear these speakers discussing topics relevant to developing secure, long-term systems for different application types. Find out more about the 2024 ADUG Symposium 1
  17. eivindbakkestuen

    GExperts 1.3.24 Beta1 for Delphi 12

    Hi, just a heads up... the Open File dialog no longer saves any size or position info, it always pops up too small in this release.
  18. eivindbakkestuen

    Use FlashFiler 2 in RAD 11.3

    It still does, they even get maintained as required. πŸ˜„ www.nexusdb.com for more info, there's a peer to peer telegram channel as well, join in πŸ™‚
  19. eivindbakkestuen

    How should spaces after a comment be handled by the formatter

    Throw an error because the line starts with a comment.
  20. eivindbakkestuen

    F6 disease still not cured in Delphi 12

    Is there a Quality Central link we can use for voting?
  21. eivindbakkestuen

    Ann: NexusDB Black Friday Sale

    happy friday! πŸ₯³ 50% off discount on NexusDB and on Nexus QA suite: coupon BLACKFRIDAY https://www.nexusdb.com/support/index.php?q=pricing
  22. Greetings all! This month 20 years ago, NexusDB v1 was released, and now we invite you to celebrate with us. The best Delphi database just keeps on going, who knows where the next 20 will take us? πŸ˜„ Some of our loyal customers who came aboard that very first year have kindly given us some words of encouragement, here are a few random ones. "It was 2003 when I was looking for an fast and reliable SQL database for the orthodontic image management software OnyxCeph. This was and is realised with the Borland (Embarcadero) C++ Builder. The new database system should be free of runtime fees and it has to support file blobs. With NexusDB, the right tool was found and I have been very satisfied with it since then. Also to be praised is the support, which works great across the time zones. Many thanks for the constructive cooperation, I wish the NexusDB team all the best for the next 20 years! Cheers! Best regards, Holger" "I've been using NexusDB for 20 years and my products have benefited greatly from its performance, reliability and ease of use. The versatility it provides with networked, local or in-memory tables makes it a great Delphi component library that I would highly recommend. Regards, Phillip" We humbly thank all of you who are already using our products, without you we would not be here today. And now... drumroll... what you have been really waiting for πŸ™‚ Until the end of this month, take 50% off any new product licenses! During checkout, apply the following coupon code: NEXUS20YEARS Please see our products here: https://www.nexusdb.com/support/index.php?q=pricing PS Our fledgling YouTube channel: https://www.youtube.com/@nexusdb9051 regards, The NexusDB Team
  23. eivindbakkestuen

    Ann: Celebrating 20 Years of NexusDB: Get 50% Off!

    It is being worked on. πŸ‘
  24. Don't miss the talk our Grande Boss (aka Geoff) is just putting together. Join now, or live with the regret! πŸ™‚ There are also plenty of other sessions, hope to see you there? https://learndelphi.org/coding-bootcamp-2023/ -- The NexusDB Team
Γ—