

PeterBelow
Members-
Content Count
560 -
Joined
-
Last visited
-
Days Won
13
Everything posted by PeterBelow
-
Are you aware that the IDE uses different layouts for design and debugging modes? Just arrange the IDE once as you want it to show while debugging, save this layout under a name of your choice, and define it as the debug layout to use. See https://docwiki.embarcadero.com/RADStudio/Athens/en/Desktop_and_Layout
-
Probably nothing :). The default setting for range checking changed to "on" and the Lockbox version in GetIt may not reflect that yet. Try to use the latest version from github instead: https://github.com/TurboPack/LockBox3
-
Well, you have to make sure the program is build with debug information (check the project options) and also check the IDE debugger settings in the Tools -> Options dialog, under Debugger -> Embarcadero Debuggers. There you find two lists for exceptions the debugger was told to ignore.
-
You usually get these "different version" errors if you have several versions of Delphi/RADStudio installed and try to move an older project to the newer version. Some path setting in the project options then may refer to a folder holding dcus from the older Delphi version and that results in this error when compiling. So check the project options, or delete the project's DPROJ file and open the corresponding DPR in the IDE to make it generate a new DPROJ. Oh, and the lib subfolders hold the dcus needed if you build a program for either the Win32 or Win64 target platform, they have nothing to do with the OS version you are running on.
-
D12.3 with latest patch. No OSX debugging suddenly
PeterBelow replied to ToddFrankson's topic in General Help
Check the blog for the patch, I think it mentions that you have to redeploy the new paserver executable manually. -
Oh, I forgot: we have C++Builder section in this forum, perhaps someone there has the old demos available.
-
For RADStudio versions before 10 the demos were part of the installation package, if memory serves, If you have not done so and are desparate enough 8-) look what is available for you on my.embarcadero.com, download older ISOs and check their content for the demos.
-
Check the Emba Github repository.
-
Custom component catching the pain process when theme enabled
PeterBelow replied to Mark Williams's topic in VCL
Try to add a class constructor and destructor to your custom control, like class constructor TMyTabControl.Create; begin TCustomStyleEngine.RegisterStyleHook(TMyTabControl, TTabControlStyleHook); end; class destructor TMyTabControl.Destroy; begin TCustomStyleEngine.UnRegisterStyleHook(TMyTabControl, TTabControlStyleHook); end; Of course you need to use your component class name instead of TMyTabControl. -
TStringGrid / TDrawGrid with goEditing off generates keystroke issues
PeterBelow replied to PiotrCh's topic in VCL
It has worked this way for many Windows versions: if the control with focus is not editable a shortcut will be triggered if the matching character key is pressed even if Alt is not held down. The VCL just adheres to that Microsoft UI design choice. You can add a handler for the parent form's OnShortcut event (or override the virtual IsShortcut method) to change the default behaviour. If you want to learn more about key handling in a VCL app here is a link to an old article of mine on the subject (Delphi 7 vintage).- 3 replies
-
- tstringgrid
- tdrawgrid
-
(and 1 more)
Tagged with:
-
Possibly interesting issue with a variant holding a Bcd.
PeterBelow replied to MarkShark's topic in RTL and Delphi Object Pascal
The error message indicates that the compiler is not evaluating the right-hand side expression as you expect. Instead of converting V to a string and concatenating the result to the string literal it is trying to convert the literal to a variant containing a TBcd, adding the two numbers, and then convert the result to a string. If you have a masochistic streak put a breakpoint on the statement, run to it, call up the disassembly view and F7 through the generated code (debug dcus need to be enabled). I would not call that a bug, just unexpected behaviour. But as you know, in programming the compiler is always right... 🙂 -
Issue with TDataModule base class without DFM (and Delphi designer opening data modules as forms)
PeterBelow replied to dan13l's topic in VCL
OK, I would not do it this way, but your problem is probably a missing FormType node in the DPROJ file. Look for nodes "DCCReference Include" and see how a "uninherited" datamodule is defined there. Compare with one of your derived datamodules. -
Issue with TDataModule base class without DFM (and Delphi designer opening data modules as forms)
PeterBelow replied to dan13l's topic in VCL
To make the inheritance work for designer classes like a data module your TBaseDataModule has to have a DFM-file, even if it is practically empty, but it must contain a valid Name property. The simplest way to get one is to create a new data module in the IDE and change its Name property to BaseDataModule, then save the unit under the name you want. You can now change the inheritance of your TMainDataModule in the editor, but you also have to switch the designer for that module to the dfm view and there change the first "object" keyword to "inherited". And make sure your TBaseDatamodule is not in the list of autocreated items! You can delete the BaseDataModule variable the IDE created for you, it is not needed. -
Microsoft has released several versions of the richedit control over the decades, TRichedit in the current Delphi version (since 11.0 if memory serves) is based on version 4 (the latest and most feature-rich). The Jedi version may be based on an older version. The divers versions are implemented in separate DLLs with different names and use different window class names, so they can coexist on a given Windows system. Different versions may explain the behaviour you see.
-
Won't the MS Store sign the package for you when you upload it? I dimly remember some mention about this (also for Google and Apple app stores) in a webinar i watched recently.
-
Is the BiDiMode property set to true on all controls in question? Also look at the methods in the see also section at the bottom of the page linked to for BiDiMode, may be important if you test on a non-hebrew locale.
-
About the compiler (not) finding the DFM files
PeterBelow replied to GabrielMoraru's topic in Delphi IDE and APIs
I just add the "library" foms to the project that needs them, this way the required path is in the dpr file uses clause. Btw.: I think this DCC_RessourcePath is for the resource compiler and you can set it under that node in the Options dialog. Never needed that myself, though.- 16 replies
-
Then why don't you delegate the hint showing to a task running in a secondary thread? The task can wait for a short interval and if it is cancelled before that interval has elepsed the hint will not be shown at all...
-
Can the UI be updated in any way while the main thread is doing work ?
PeterBelow replied to dormky's topic in VCL
The answer is no since the update would have to be triggered somewhere from inside the work code. But you can create and show a window from a secondary thread, it is just a bit cumbersome to do since the visual part of the VCL is not thread-safe. The secondary thread needs a message loop that will process all messages for the window, including timers and paint messages. The simplest way to get that loop is to show the window modally. And the safest way to do such stuff is to not use a Delphi form but do it all the API way (hence the cumbersome part above 8-)). If you want to use a Delphi form the important points to mind are: Do not autocreate the form! Create the form inside the Execute method of the secondary thread, using Nil as owner. Use a try finally block to make sure the form is destroyed. Use a field of the thread class to store the form reference. ShowModal the form. Add a public method to the thread class the main thread can call to get the form to close once the work is done. The method should set the form's ModalResult to mrCancel to allow the modal loop to exit normally. -
Try to set the KeyValue property to the ID you want to look up.
-
A Windows service should to all of its work in a secondary thread started in the OnStart event (and terminated in OnStop, perhaps also paused and resumed if possible in the corresponding events). The main thread should only process commands received from the service manager, which TService handles internally. That aside: from a look at the source TServiceApplication actually starts any services in a secondary thread and, after launching that, goes into a simple loop (actually it calls Vcl.TApplication.Run) which does the normal Idle processing, including the CheckSynchronize call that handles queued or synchronized tasks from background threads. So your construct will probably work, but I would not go this way in a service application. If the queued call blocks for some reason that would prevent the service app from terminating.
-
The control has a ShowCheckbox property. This gives the user a checkbox to check or uncheck to indicate a NULL or NOT NULL state. The Checked property then tells you the user's descision. A bit cumbersome but the Windows common control behind TDatetimepicker has no concept of an "empty" state.
-
How can I use pointers to access the value of a dmArray = TList<dmRecord> record?
PeterBelow replied to skyzoframe[hun]'s topic in Algorithms, Data Structures and Class Design
A TList<T> has a constructor overload that takes a comparer (IComparer<T> instance) to use for sorting and searching the list by default. The Sort method also has such an overload. You use TComparer<T>.Construct() to fabricate a suitable comparer on the fly, providing an anonymous method that does the actual comparison of two items in the way you want the sort to go. This anonymous method has to "know" the record type in question, so you can directly refer to the fields of the two items passed to it. Forget about pointers, you do not need them to work with generics. -
Set the DefaultMonitor property of the form to dmDesktop, this way the form left and top do not depend on the monitor the form is on and will restore the form to the monitor it was on before (unless the user rearranges his desktop configuration). For the necessary code see the PB.Winset unit in the attached archive. Winset.zip
-
Well, well, has been some years since somebody asked about chemistry here 8-)... As it happens I am a (retired) organic chemist and have worked for more than 30 years for a german (later french) pharma company in research. I wrote a lot of software working with chemical information, mostly from chemical databases. While the core of my library depended on MDL (later Accelrys) ISIS (long dead) and their Oracle chemistry package I tried during my last year at the company to get rid of the ISIS dependency by creating a Delphi wrapper for the Indigo library. Unfortunately I did not have enough time to complete and test the wrapper, and it is based on the 2017 32-bit Indigo DLLs, but perhaps you can find something of use in the mess. I also included some other units related to chemistry in the attached archive without ISIS dependencies. Have fun ;). chemistry.zip