

JonRobertson
Members-
Content Count
289 -
Joined
-
Last visited
-
Days Won
7
Everything posted by JonRobertson
-
How to debug a Not Responding program element
JonRobertson replied to Willicious's topic in Delphi IDE and APIs
Classes do not need a destructor to be destroyed/freed. A class needs a destructor if it allocated other objects or memory that it should free or there is other cleanup it needs to do before being destroyed. If an object is not being freed, adding a destructor would not fix the issue. Read the comments in FastMM4Options.inc. Specifically: {Set this option to log all errors to a text file in the same folder as the application. Memory errors (with the FullDebugMode option set) will be appended to the log file. Has no effect if "FullDebugMode" is not set.} {$define LogErrorsToFile} {Set this option to log all memory leaks to a text file in the same folder as the application. Memory leak reports (with the FullDebugMode option set) will be appended to the log file. Has no effect if "LogErrorsToFile" and "FullDebugMode" are not also set. Note that usually all leaks are always logged, even if they are "expected" leaks registered through AddExpectedMemoryLeaks. Expected leaks registered by pointer may be excluded through the HideExpectedLeaksRegisteredByPointer option.} {$define LogMemoryLeakDetailToFile} It has been a while since I did this. I found a post on SO for a reminder. Based on that post, copy FastMM4Options.inc to your project folder. Edit the .inc file and remove the period from {.$define FullDebugMode} Do a full build of the project and any leaks should be written to a text file with additional information about the object leaked and when it was allocated. -
Variable might not have been initialized
JonRobertson replied to shineworld's topic in Delphi IDE and APIs
👍 I set that compiler warning (and a couple others) as an Error in every project: -
That sounds like much more code than necessary to me. I have a base form with a TDataSet field named StateDataSet and a virtual method called UpdateUIState. Each derived form assigns StateDataSet during FormCreate and overrides UpdateUIState to update the UI based on various conditions, such as TDataSet.State and user security for that form/data. Both the base form and the derived user form is "aware" of the record operation (view, insert, edit) by looking at StateDataSet.State. Every form has a ValidateForm method to ensure that required fields are provided and any referring data is valid before the record is posted. I avoid writing anything to the database unnecessarily. Adding a row temporarily that will be removed if the edit is canceled is wasteful network and disk I/O as well as increasing db index and page fragmentation. Some customers now use a "cloud hosted" database server, so database read/writes also have extra latency. Doing as much as possible in memory is a huge performance gain. I find it much easier to maintain a single form (per table/record). I don't have to take the time to update two or three forms when changes are needed and ensure that the implementation is consistent across multiple forms/units. FWIW, my data edit forms have a lot of common functionality that is implemented in the base form, not just StateDataSet and UpdateUIState.
-
I wouldn't use a separate flag unless necessary. If you are using a TDataSet descendent, you can look at the State property to determine whether the record is being inserted (State = dsInsert) or edited (State = dsEdit). If it is necessary to call Post in code, you can use if ds.State in dsEditModes to determine if the current record needs to be posted.
-
I suspect to gather material for Jim's upcoming webinar.
-
Using reFind to remove property of a specific component
JonRobertson replied to JonRobertson's topic in Tips / Blogs / Tutorials / Videos
I created RSS-1136. This is my first QP under the new portal. I suppose I need to figure out a way to enter a QP for the new portal. It seems odd that the list of "Components" is so limited. This QP does not fit under "IDE", but I couldn't find a better "Component" to specify. -
Delphi 12.1 Amnesty price isn’t what I thought it was…
JonRobertson replied to Al T's topic in Delphi IDE and APIs
So Microsoft Windows Professional, SQL Server (not Express), and most of their other "Enterprise" software aren't enterprise software applications? -
Delphi 12.1 Amnesty price isn’t what I thought it was…
JonRobertson replied to Al T's topic in Delphi IDE and APIs
I don't understand why anyone would compare Microsoft's business motives to Embarcadero's. Microsoft's bottom line is based on the success of their platforms (Windows, SQL Server, Office 365, Azure, ad nauseam). They could give Visual Studio Enterprise to every interested developer for free and not need to worry about paying the bills. Or their Visual Studio development team's salaries. Embarcadero's bottom line is based on the success of development tools and Interbase. They don't spend resources on Delphi and C++ Builder so they can profit from an operating system or hardware platform. -
When I initially installed Delphi 11.0, I went through GetIt and installed several items, including the Parnassus Bookmark and Threaded Debugging plugins. For the next couple of months, the Delphi IDE was more unstable than any previous version. It was bad enough that I emailed my account rep and she arranged an online call. The short version is that once I uninstalled both Parnassus plugins, exceptions stopped occurring in the IDE. I occasionally see one today, but that is typically after having an instance of the IDE open for several hours using the debugger heavily.
-
What version of Delphi has the least amount of bugs throughout history?
JonRobertson replied to Al T's topic in Delphi IDE and APIs
My favorite versions, which has a lot to do with stability, were Delphi 3, 6, and XE2. At a prior position, the company stayed on Delphi 6 for 9 years. Delphi 7 didn't have any benefit for us and then Borland chased the white rabbit down the .NET path... We started migrating with Delphi 2009 but did not have a stable release candidate until Delphi XE2. That was primarily due to switching our product from DCOM DataSnap to dbExpress DataSnap. Same here. I currently maintain a few apps that are Delphi 7 projects, and most will likely not be migrated to a newer Delphi. I use Delphi 7 in Windows 10, sometimes several hours a week. Although being used to the functionality of newer IDEs, I get frustrated at the difference in productivity using Delphi 7. -
Delphi 12.1 Amnesty price isn’t what I thought it was…
JonRobertson replied to Al T's topic in Delphi IDE and APIs
Same here. I brought this up with Ian Barker and my assigned rep. I asked that as well. Yep. Wash, rinse, spin, dry, repeat. But wait, those clothes just came out of the dryer... It helped for a little while. But I am back to receiving multiple "upgrade" or "renew" email offers every week, sometimes multiple times in one day. And our licenses do not expire until February, 2026. But the ones that I find most frustrating are the "personal" emails asking if I'd like a demo of the development tool that has been my tool of choice since 1996. -
RAD Studio 12 Update 1 IDE Instability
JonRobertson replied to Navid Madani's topic in Delphi IDE and APIs
Just my experience, I had major issues with IDE instability when I started using Delphi 11. I had a call with one of the product managers and showed the issues that I was having. His suggestion was to remove packages and add-ins to find the cause, which I had been too lazy to do at that point. Once I removed Navigator and Bookmarks, all of the IDE instability disappeared and I've rarely had an issue since. -
Selection in FormDesigner Structure barely visible when not focused
JonRobertson replied to PeterPanettone's topic in Delphi IDE and APIs
Probably. Microsoft changes how they think the Windows UI should work on a regular basis. -
Why does IDE require UAC elevation when starting?
JonRobertson replied to Tom F's topic in General Help
This is a stretch, but you could extract the manifest from your bds.exe and verify that the manifest is not requiring elevation. The link has a sample command-line, which I just used on my bds.exe. If you have Visual Studio installed, mt.exe should already be on your machine. I don't know if there is a way to get it that is simpler than installing the Microsoft Windows SDK. I can't imagine this is the cause with a standard install. But there is something triggering the request. The manifest should contain this line: <requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel> -
You could try an alternative to Lajos' suggestion. Manually launch a second instance of Delphi, and then use Run->Attach to Process to attach to the first. You will want to check Task Manager before launching the second instance, to get the PID of the first. You will see both instances in the Attach to Process dialog.
-
Installing the package will require Delphi to call Register. I doubt that Delphi calls Register every time it loads a package. @Dave Craggs Since you are building, do you have source for all of the components in the package? You could add OutputDebugString logging to the Register procedure as a start, to narrow down the component causing the AV.
-
Why does IDE require UAC elevation when starting?
JonRobertson replied to Tom F's topic in General Help
Have you tried launching BDS with a different registry key? This would not load components installed after the IDE was installed. In my tests, experts and add-ins are still loaded. For example: bds -r"clean" I wonder if there is something else (such as a DLL) being loaded by the IDE that is triggering the elevation requirement. Using Process Monitor could be helpful to track what BDS is doing before the elevation dialog appears. -
Either the error you posted is not a true copy of the error message or something is wrong in your DPROJ. There are no "vcl.dcp.vcl.*" files in the Releases folder or any other folder under Embarcadero\Studio\... My suspicion is that you are building a project for 64-bit and the compiler is finding a DCU previously built for 32-bit. If the unit's source has not changed, the compiler will not rebuild the DCU even though the DCU was built for a different platform. I wish the compiler dealt with this better. The first thing to try is Project->Build (Alt-P then B, or Shift-F9 should also work). If you still get a similar error, post the error message again and your DPROJ file, if possible.
-
That would work for a DLL that contains native code and uses ANSI char based null-terminated strings. The code posted is C# code, using a .NET System.String class "Representing text as a sequence of UTF-16 code units" The DLL generated will be a .NET assembly containing managed code, not native code. As Peter mentioned earlier, either the DLL has to be written & compiled to support COM interop https://blogs.embarcadero.com/using-a-net-assembly-via-com-in-delphi/ https://www.blong.com/Conferences/BorCon2004/Interop2/COMNetInterop.htm#CCW or the Delphi application that loads the DLL has to host the CLR before the DLL is loaded. https://stackoverflow.com/questions/2048540/hosting-clr-in-delphi-with-without-jcl-example https://stackoverflow.com/questions/258875/hosting-the-net-runtime-in-a-delphi-program https://en.delphipraxis.net/topic/1744-net-runtime-library-for-delphi/ https://adamjohnston.me/delphi-dotnet-interop-with-jvcl/ "Explain step by step" isn't possible, as there are a lot of factors to consider. I suspect this is why there are commercial libraries that do this. https://www.remobjects.com/hydra/ https://www.crystalnet-tech.com/ https://www.atozed.com/crosstalk/ There was a library called Managed-VCL, which can be found online. But the website vanished a while back.
-
WebUI framework: Technical preview. Part 1.
JonRobertson replied to Alexander Sviridenkov's topic in I made this
You have a couple of "bundles". Do you mean the three library bundle? I'm curious as a potential customer. -
Delphi and "Use only memory safe languages"
JonRobertson replied to Die Holländer's topic in General Help
Different languages have different rules and syntax. Is that really an issue? I see the "issue" as developers using the incorrect syntax for the language they are currently using. If I toured Italy, I imagine my trip would be more enjoyable if I spoke Italian. Which I don't. -
Delphi and "Use only memory safe languages"
JonRobertson replied to Die Holländer's topic in General Help
Should that matter? I started learning Pascal 35 years ago and C the following year. Not once have I written c := (a < b) ? a : b; or if (a == b) { doSomething(); } while writing Pascal code. -
ActionList Editor: New Standard Action...
JonRobertson replied to PeterPanettone's topic in General Help
Works for me as well in 11.3. -
D2007: Initialise byte array in const record
JonRobertson replied to Nigel Thomas's topic in Algorithms, Data Structures and Class Design
What do you get when you try const sig1: FileSig = (Offset: 10; arrSig: [$00,$01,$02]; ) in D2007? -
Delphi and "Use only memory safe languages"
JonRobertson replied to Die Holländer's topic in General Help
Unfortunately, many are still just that.