Form of the template being resized when it is opened in the IDE. How to avoid this?
Problem with template in ide
TMapMarkerDescriptor.snippet is not an InfoWindow?
Hello,
As I know, an InfoWindow of a Marker in the GoogleMaps can have HTML code and it can show 'everything' (Texts, Images, Buttons, etc., as a little webpage).
Is it possible to have an Image on a Marker's snippet in Delphi, or it is only a text area?
Thanks
TeeChart for RAD Studio 10.1
The feature list for RAD Studio 10.1 indicates it includes TeeChart but it is not installed in the Tool Palette and I cannot find a design time package to install. The GetIt Manager doesn't list TeeChart as an option. What do I need to do to install TeeChart in RAD Stuation 10.1?
Compiling HiRedis, the official C Client of the Windows port of Redis with C++ Builder
Hi all,
I'm in the process of building Hiredis, the official C client library for Redis (Windows port of course) using C++ Builder.
Windows port of Redis is a fork maintained by Microsoft Open Tech community and is of course tight to MS compiler and libraries. In fact, there is no luck in trying to compile the source just "out of the box" as Visual Studio does, even if the source is straight standard C (well, at last the original Redis code).
The source can be found here: Windows port of Redis
I know there is a Delphi client available, but it really sounds sad (and frustrating) to me having to import the Delphi code because the "native C source" cannot be used. No way. That's why I decided to give it a try.
To compare sources an libraries involved, I'm using C++ Builder 10.1.2 (Berlin Update 2) on one side and Visual Studio Community 2017 on the other side. The basic steps using C++ Builder are:
(Edit: I edited the post and removed all code formatting features because I had problems with it. Also, for the same reason all #include in the post has standard parenthesis instead of "minor and major" chars. Sorry for that.)
- Download of source version redis-win-3.2.100
- Create a new Static Library project called Hiredis and add some files contained in the "redis-win-3.2.100\deps\hiredis" subfolder:
async.c
hiredis.c
net.c
sds.c
There is a solution project available for Visual Studio under "redis-win-3.2.100\msvs\hiredis" ready to compile, that's where I took the list of files to add. Headers are also added to the MS project, but as far as I can see, there is no difference if you keep them off.
Anyway headers are:
async.h
fmacros.h
hiredis.h
net.h
sds.h
win32_types.h - Setup the project to use Clang based compiler (not really needed as this should be standard C code, but see later)
- Build
The project fails to compile as I said, here is a step by step description of the issues and fixes I used. After each fix I usually compile the single unit or directly build the whole project. Each fix provided must not break the original source which still compiles using MSVC, this will be eventually a requirement when talking about pushing the code to the MSOpen Tech community.
- First error: [bcc32c Error] Win32_Error.h(37): unknown type name 'size_t'
Fix: added a conditional block and the relative include to the header that contains that type.
#ifdef __BORLANDC__
#include (stdlib.h)
#endifThis error is due to the fact that inside Win32_Error.h there is another include and this header in MS C Runtime Library version contains another include to a Visual C header. (Kudos to Embarcadero C Runtime Library version)
- Second error:
[bcc32c Error] _stddef.h(45): typedef redefinition with different types ('int' vs 'long')
Win32_types_hiredis.h(44): previous definition is here
Fix: added conditional block wrapper to avoid type re declaration.
#ifndef __BORLANDC__
typedef long ssize_t;
#endif
_stddef.h already contains that type (int instead of long, but it's quite good for now) - Third error: [bcc32c Error] stdio.h(56): typedef redefinition with different types ('long' vs 'long long')
This error is due to the re-definition of the type off_t inside the file win32_types.h provided in the hiredis source.
Now, according to the info in "win32_types.h" they need to re-define bothoff_t
and_off_t types
to match Posix version of Redis.
But, in order to use this definition without conflicts you need to include this header before any other inclusion of the original header "sys\types.h", which contains the original types definitions under a conditional define (_OFF_T_DEFINED).
Win32_types.h will also define _OFF_T_DEFINED to avoid subsequent types re-definitions. (anyway MSVC has an additional conditional define _OFF_T_DEFINED at project level.)
Now, on MS Visual Studio C Runtime Library, "stdio.h" does not contain "off_t" type definition, that's why it everything works. Moreover, Embarcadero C Runtime Library has no conditional defs to skip off_t and _off_t definitions inside "sys\types.h" as MS does.
First Fix: I'd rather not modify C Runtime Library headers at all, but at the moment I have no other options. To minimize modifications on such files, I choose to "cut off" stdio.h definitions by adding a define just above the header inclusion, inside the file "Win32_FDAPI.h":
#ifdef __BORLANDC__
#define __STDC__ 1
#endif
#include (stdio.h)
Luckily (..well, hopefully) _off_t is wrapped in a conditional #if !defined(__STDC__), that's why the definition just above the include does the job. Unfortunately this solution cuts away some other options (#pragma warn -nak for example) and others, but it seems to be OK, for now anyway.
Second Fix: I have no other option here than modifying Embarcadero C Runtime Library header file "sys\types.h" and wrap the off_t type definition with the above mentioned _OFF_T_DEFINED, just as in MS Visual Studion C Runtime headers:
#ifndef _OFF_T_DEFINED
#define _OFF_T_DEFINED
typedef long off_t;
#endif
- Fourth error: [CLANG Error] sds.h(53): expected identifier
The file contains an helper macro to pack structs. The macro uses __pragma() compiler extension to allow the usage of pragma "in-a-macro". According to the compiler documentation, also thanks to this answer on StackOverflow from Remy Lebeau, old BCC32 does not support this statements. But Clang based compilers do. This is the first fix that is tight to Clang compiler, even if we could build a different solution by using #pragma as stated in stakoverflow post by Remy to have BCC32 working.
Anyway, I was not able to make __pragma() work that way, so I created another macro using _Pragma() instead and that worked fine.
#if defined(__BORLANDC__) && defined(__clang__)
#define PACK( __Declaration__ ) _Pragma( "pack(push, 1)" ) _Declaration__ _Pragma( "pack(pop)" )
#else
#define PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
#endif
- Fifth and sixth errors:
[CLANG Error] win32_types.h(37): typedef redefinition with different types ('long long' vs 'long')
stdio.h(56): previous definition is here
First Fix: same solution used for "third error". Add __STDC__ definition just above the include inside "net.c"
Second Fix: according to the remark near stdio.h include, that header is included only to provide "size_t" type. Actually on Embarcadero C Runtime Library, that type is defined in "stdlib.h".
Therefore I added a conditional block to include "stdlib.h" instead of "stdio.h" inside "hiredis.h" source.
#ifdef __BORLANDC__
#include (stdlib.h) /* for size_t */
#else
#include (stdio.h) /* for size_t */
#endif
- Seventh error. Here is where I stuck.
[CLANG Error] hiredis.c(1041): conflicting types for 'redisConnectWithTimeout'
hiredis.h(184): previous declaration is here
As sometime happens the compiler message is not really helpful. In fact the problem is not 'redisConnectWithTimeout' function prototype but rather one of the parameter types used in it, timeval which is defined in "winsock2.h".
For some strange reason, on MSVC this type definition is known in hiredis.h at function declaration, even if winsock2.h is not included by any of the include entries, nor in any sub-includes. Unfortunately, any inclusion of winsock2.h leads to an incredible amount of other errors which make me think about searching for another solution.
Here is where I lay by now, welcome contributions from anyone can help.
Thanks.
Alex B.
Context help not installed
I have an installation of Rad Studio 10.2 installed on my PC that was installed for me, when I press F1 to invoke the context help I get the following error:
'RAD Studio's help is not installed. Please Re-install RAD Studio's documentation.'
Also, when using the drop down help menu there are no options under 'Help -> Delphi Help'.
I've tried to run the installer to add the help files but the only option I have is to uninstall and re-install RAD Studio which I don't want to do.
I've also downloaded the help files and copied them to C:\Program Files (x86)\Embarcadero\Studio\19.0\Help\Doc which hasn't resolved the issue.
Is there a method to install the help files so that RAD Studio recognises them without having to reinstall the entire product?
Thank you.
FMX C++ Builder App on MacOS crash on start with 10.2
Have a project that worked fine with 10.1 Berlin for the three target environments: Win32, Win64, and MacOS/OSX.
Load the project up in 10.2 Win32 and Win64 work fine, but MacOS/OSX version crashes during startup (before executing any of the .cpp files in the project). Thus have been unable to debug it.
As a further test: I created a blank project which works fine in all 3 (just to make sure everything is correct) started adding the same components to the FMX Form on the test project--everything worked...
2nd test: Create a blank FMX application and then add all the files from the original project to it. This results with the same crash as with the original application.
Looking at the stack trace the crash appears to be related to styles (there is no stylebook associated with the form, and even if one is added the application still crashes in MacOS/OSX).
My 10.2 is up to date (including the latest patch recently released).
Android multi languages app - playstore
Hello I have written an app for Android which supports German, English, French, Spanish and four other languages. No problem it works. The problem is, that the playstore analyse the app and thinks that there is only one language. Is there a method (e.g. in the manifest) to declare that this app has more languages ? I'm using Delphi Seattle (Update 1). Thanks for any help Michael
bcbie250.bpl package for RAD Studio 10.2 IDE
I am migrating legacy code from Codegear C++Builder2007, which had a Tool Palette category of Internet with the TCppWebBrowser component, to C++Builder 10.2, which does not have this category or the component in any other category. On the EDN forum, I was told to install the relevant package (bcbie250.bpl) into the IDE. Where do I download this? I have searched Embarcadero and did not anything. Thanks.
Bill
Retrieving real gps status
Hi, how can i retrieve the real status of a gps sensor on android or ios?
TSensorManager returns a LocationSensor
With a timer i'm printing the TSensorState flag, but it returns every time a Ready State even if i disable the Gps and/or the Wifi option on the device.
Thank you
Error when compiling for 64 bit windows: frxClass not found. For 32 bit windows it's working well
Hi,
I get an error message when compling for 64-bit windows: [dcc64 Fatal Error] uFormRekeningschema.pas(7): F2613 Unit 'frxClass' not found.
But if I compile for 32 bit windows this error don't appear. Do you hav any idea how to fix this for the 64-bit windows?
Kind regards,
Jacques Kuipers
How to determine why the compiler is so slow when working on some of my units?
We have an old project that has been growing over the time. Right now a build will compile around 700,000 lines of code. Total process is around 9 minutes to complete.
The build process is very fast compiling the first units, so 400,000 lines of code are compiled in 20 seconds, and you can see the line counter moving very fast. Then the process slows down, always in the same set of units, and the line counter freezes and updates not so frequently. Compiling this group of units takes 6 or 7 minutes. When they are done, process speeds up again to complete the process.
Obviously, we are checking this group of around 10 units looking for something different from the rest, but we have not seen anything special.
We have used also CnPack wizards to clean unnecessary uses. Some uses have been removed, but the process speed has not been improved.
Any ideas on what to check? How to find out why these units are so slow to compile?
Is this valid Delphi code?
I played around how I can best wrap a Class (TBase) inside a Container that I have limited access to change.
Is this valid Delphi Code? It seems to work.
type TForm1 = class(TForm) procedure FormShow(Sender: TObject); private { Private-Deklarationen } public { Public-Deklarationen } end; TBase = class public bar: Integer; end; TSpecial = class(TBase) public foo: Integer; end; TBaseContainer = class public base: TBase; end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormShow(Sender: TObject); var baseContainer: TBaseContainer; begin baseContainer := TBaseContainer.Create; baseContainer.base := TBase.Create; baseContainer.base.bar := 5; TSpecial(baseContainer.base).foo := 3; ShowMessage(baseContainer.base.bar.ToString); ShowMessage(TSpecial(baseContainer.base).foo.ToString); end;
What does the Compiler do in line "TSpecial(baseContainer.base).foo := 3;"? What memory is used?
Problem with form height in IDE
Form 800x600 being resized to 800x580 when the form is opened in the IDE. What to do?
Delphi v6 exe size 2.3MB, migrated to v10 and exe size 4.6MB
I have recently migrated from Delphi v6 to Delphi 10 Starter edition. I loaded a v6 project to v10 and found it very easy to get it working fine. But the executable file created by v6 was 2.3 MB, and that created by v10 is 4.6 MB. I only made a few trivial changes. Is this something to do with the units I am including in the "Uses" clauses? I did find somewhere that Embarcadero were offering an app to "clean up" the uses declarations, but cannot relocate it now. Any suggestions would be very much appreciated.
Windows 10 64 bit, Delphi v10 Starter edition.
How to make custom 3D Plot?
Hello everyone,
Suppose, you have an array of 3D Vectors which leads to the particular class defined by user. This 3D Vector class consist of three double variables x, y and z. The questions is: what is the best way to represent the array data graphically? It means, to create custom graphics in 3D using ready set of data (3 points of type double consisting of a specific class.)
Thank you in advance,
Johnny..
FMX Android apps do not draw some forms after Tokyo update
I have a number of FMX based programs that do not draw there forms correctly when built for the Android platform under Tokyo. The programs work fine on Berlin update 1 and 2. The same programs complied for Win64 or Win32 under Tokyo seam to work fine.
I have only had time to test the android apps on a Samsung S5 (6.01), S6 (6.01) and a Samsung TabS (6.01).
Each of the programs has 8 to 10 forms. When a form is shown it does not always display but the controls on the form are active.
The programs use a local SQLite database using FireDac and live bindings to display data. All of the forms which use live bindings from the FireDac database to one or more ListViews in a MultiView will not draw at all. While you can not see the form all of the forms controls are active.
I have one application form that uses live bindings but has no MultiView. The form has a hidden panel (visible=false). When the panel is made visible the form does not update to show the panel but the controls on the panel are active.
In the IDE I can not show the contents of a MultiView when the "Master" form layout is selected. If I select the "Windows" or "Android" layouts the show command displays the MultiView.
Code Insight breaks after Task.Run and in long units (> ~ 1200 lines)
Hi, ...
I've experienced that long units (approx. over 1200 lines), Code Insight breaks down in this manner: Reference to items from other units no longer works when typing the dot (or pressing ctrl+space). Even after waiting seconds, no external names are suggested when typing.
A similar reference to same external unit in a small unit (ex. 150 lines) immediately results in the correct behaviour in the IDE.
After using the threading functions, the IDE starts to insert the text "end;" EVERY time enter is pressed in the source code in the unit. That is, after code like the example below, sometimes the editor starts this strange behaviour - like it's lost count of corresponding begin-end pairs. Code:
TTask.Run(procedure
begin
; // Code here
end);
Are there anything I can do to "help" the IDE or "clean" the unit's definition, so as to make the Code Insight / IDE work as expected?
I'm using Delphi 10.2 on Windows 10 Creators, the project is 32-bit for VCL.
Best regards,
Carsten
Rad Studio IDE bricked on splash screen in Windows Insider Build 16184, 16188
Windows Insider build starting from 16184 are not compatible with Delphi IDE, staying locked on splash screen forever.
Yes, Windows Insider Build are Beta version(s), however Delphi is the one and only software I am aware of that bricked under those builds.
I suspect a Delphi issue, probably the protection and online activation module that is again at fault trying to protect itself.
As it is reasonable to think Microsoft is not the culprit here, and as being in Windows Insider program is sometine not an option for software vendors, Embarcadero/idera should at least investigate the issue and report - ideally provide a quick fix.
If one's answer is "don't use Windows Beta", then just don't waste the time to write it.
ADO and RAD Studio
Hi all,
I'm brand new to RAD Studio (Delphi for win32, free), since I'm coming from "old" Borland Turbo Delphi - I'm a hobby developer, not sure a pro one - and just few days ago I've installe RAD Studio 12.2 for the first time.
I've tried to import a project I wrote years ago With Turbo Delphi, a recipes manager based on ADO databases, but I get (obviously) a component error because RAD Studio can't load TADOTable, TADODb, and so on.
So my question is: is there a way to load ADO components in Rad Studio, and - if yes - where can I find the component suite? And, if not, must I rewrite the whole code using TDB components in place of TADO components.
Thanks and cheers,
Melantho
Memory Access Error Delphi Studio 10, 32 bit
In moving code from Studio 5 to Studio 10 I am repeatedly getting many stupid memory access errors.when I try to read or write data to a data structure. Yes, the program does list the form to be created so the structure should be there. I am calling the element with a full path name of unit, structure and element and the compiler is happy. One element was an Int32 which kept dying until I changed it to an Integer (on a 32 bit compiler - duh). Now I am dying on a defined set that works fine under Studio 5. Is there an update to fix these compiler errors? Have I exceeded a memory size? Can't believe that. The stack is set for 16 meg. All unit are included in the program list and all forms are set to auto create.