Leaderboard
Popular Content
Showing content with the highest reputation on 08/14/20 in Posts
-
Is interposer class really best to customize TPanel.Paint?
Fr0sT.Brutal replied to Mike Torrettinni's topic in VCL
This means all the visual component mess: separate package, installation, registration, replacing existing panels, bundling it with an app etc. TPanel = class(Vcl.ExtCtrls.TPanel) protected procedure Paint; override; public OnCustomPaint: TNotifyEvent; end; procedure TPanel.Paint; begin if Assigned(OnCustomPaint) then OnCustomPaint(Self) else inherited; end; I would do something alike -
System.GetMemory returning NIL
Mahdi Safsafi replied to dummzeuch's topic in RTL and Delphi Object Pascal
@dummzeuch Yes FastMM can handle it but OS provides much options(ZeroInit, FileMapping, ...). Besides the behavior when OS fails is very well documented. Anyway, there is no harm to use FastMM ... after all it will call OS functions. or temporary solution : var OriginalMemoryManager: TMemoryManagerEx; NewMemoryManager: TMemoryManagerEx; function NewGetMem(Size: NativeInt): Pointer; begin Result := OriginalMemoryManager.GetMem(Size); if not Assigned(Result) then raise EOutOfMemory.Create('Error Message'); end; begin GetMemoryManager(OriginalMemoryManager); NewMemoryManager := OriginalMemoryManager; NewMemoryManager.GetMem := NewGetMem; SetMemoryManager(NewMemoryManager); end. -
What "Project analyzers" out there.
Bill Meyer replied to Tommi Prami's topic in Delphi IDE and APIs
Pascal Analyzer Lite is helpful; I have not used the full product. It is the only tool I have used which can advise as to uses references which can be demoted from interface to implementation. It does give some false positives, however. The CnPack Uses Cleaner is also helpful, though like Pascal Analyzer Lite, it will give some false positives. It doesn't take long, however, to build a mental list of the modules you can't remove, despite its advice. MMX is great for tabulating unit dependency cycles, and although the report it generates is huge, it is easily parsed, and I have built a simple tool to do that and present in a grid the cycle counts per unit, which is helpful. DUDS is quite fast, and its tree view seems to me to communicate a more useful sense of dependency relations than the Cartesian map in MMX. I have not found any single tool which does all that I could wish. The Pascal Analyzer Lite Uses report is very useful, and for demoting uses references, MMX is far superior to hand editing. Pascal Analyzer Lite is slow, and if your project is large, definitely use the 64-bit version, or it will run out of memory. If you are in a VM, give it plenty of RAM. PAL has used about 2.6GB on the large project I have been reworking. The thing I really would like is to find a tool which can help you discover which modules in dependency cycle chains are villains, and which are victims. In a large legacy project, it is very difficult to identify the modules which are most in need of rework. -
I working on a dll expert right now, and I find it useful to use a separate registry for debugging the IDE, so that it only loads my expert and not 20 other things I typically have installed. You can do this in the Run Menu, Parameters dialog, under the Host application, add -rOpenToolsApi The name after -r doesn't matter, as long as it's unique Run that once, it won't load your expert, but will create a new entry under HKEY_CURRENT_USER\Software\Embarcadero You can also use that run to remove any libraries or experts you don't need for debugging.. speeds up startup a lot. After that you can manually add your expert to the Experts key and then start debugging. This is useful for testing bpl experts too.
-
Why should I use good source control versioning system?
Vincent Parrett replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
Interesting. I haven't used Semantic Merge either, but was considering trying it for our .net code(c#), we're in the process of migrating a huge codebase to .net core and have had quite a few merge issues lately semantic merge could possibly have dealt with better. I have so many other open source projects on the go at the moment, so I will have to restrain myself from taking on another one (tempting as it is!) - I also have a day job, admittedly working for myself, but I often have to restrain myself from working on fun projects so I can earn a living! -
share extensin IOS App receive shared web link from Safari and Other apps
Allen@Grijjy replied to Massimiliano S's topic in Cross-platform
Did some more reading here. Apple specifically says that extensions are not allowed to launch their host application unless it's a Today widget, "A Today widget (and no other app extension type) can ask the system to open its containing app by calling the openURL:completionHandler: method of the NSExtensionContext class. " https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/ExtensionOverview.html#//apple_ref/doc/uid/TP40014214-CH2-SW2 You may get rejected by Apple from the App Store for violating guidelines. That being said, I suspect from reading on StackOverflow that is exactly what some Share extensions are doing and they are in the App store. I attached an example ShareViewController.m that *may* work. Of course you will need to modify the urlString and replace https:// with abcd:// to launch the Url Protocol handler. ShareViewController.m- 31 replies
-
@Mahdi Safsafi Might be simpler to just redirect System.GetMemory instead of the memory manager's GetMem which is called by other methods doing a reOutOfMemory check themselves.
-
System.GetMemory returning NIL
Stefan Glienke replied to dummzeuch's topic in RTL and Delphi Object Pascal
Look into the implementation of System._GetMem and compare that with System.GetMemory and you know the answer. -
Is interposer class really best to customize TPanel.Paint?
Rollo62 replied to Mike Torrettinni's topic in VCL
I can agree to that, since I use interposer heavily. Some years ago I have heard that some people have the philosophy to wrap everything into interposers. I'm not going that far yet, but close. I can understand well to have a "safety" layer between the framework and your app. That serves a lot of useful purposes: to easily manage bugfixes at a centralized place for each component to make workarounds around some conceptual limitations of some components to enhance the components with new, custom features they don't interfear with normal designer process, so no need to install custom components That are enough reasons for me to consider interposers everywhere 🙂 -
I'm just suggesting things to check. What do you mean by "the second Delphi"? Just to make sure You have got two instances of the IDE running: The instance you used to compile and run your expert, which I would call "the first instance". That's the one that is doing the debugging. The instance you started as the host application for your expert, which I would call "the second instance". You should place breakpoints and look at the source code in the first instance. You must always be sure that the expert loaded in the second instance is the one you just compiled. Ideally the expert should not be loaded at all in the first instance. If it's a package based expert that's easy to do by only manually installing the package in the second instance. For dll base experts it's more complicated. For GExperts I am using a pre-build script that renames the existing DLL GExpertsXX.dll to GexpertsXX.dll~ so the second instance will always load the new dll while the first instance will keep on using the old one. Also: Always make sure you are building in debug mode. If you simply compile, some or your units may still be compiled without debug information. As I said: I'm trying to suggest what to check. You probably have done some of it already.
-
Is interposer class really best to customize TPanel.Paint?
Dave Nottage replied to Mike Torrettinni's topic in VCL
I usually add a Boolean value to the interposer and set it to True when the form is created, only for those components with the specialised behaviour. -
Why should I use good source control versioning system?
Vincent Parrett replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
I assume you mean SemanticMerge rather than plasticscm (same company, different product)? I didn't think it had a parser for delphi? That would be a fun project, using https://github.com/RomanYankovsky/DelphiAST perhaps. We use Beyond Compare (written in Delphi, built with FinalBuilder!) - can't fault it and the price is very reasonable. -
High-level interface-based encapsulation of Direct2D Svg functionality
Carlo Barazzetta replied to pyscripter's topic in Windows API
Today I've merged the great work made by @pyscripter and @Vincent Parrett into SVGIconImageList project and released 1.8 version. Now with the new components SVGIconImageCollection and SVGIconVirtualImageList it's possibile to build multi-form High-DPI app in a multi-monitor environment using a single ImageCollection shared by the forms. Many SVG rendering problems are now fixed! -
New annoying IDE malfunction
PeterPanettone replied to PeterPanettone's topic in Delphi IDE and APIs
I have added @Anders Melander to my ignore list. So in the future, it's useless for him to write comments directed at me. -
New annoying IDE malfunction
PeterPanettone replied to PeterPanettone's topic in Delphi IDE and APIs
Why do you waste your time criticizing things which are out of your reach?