Questions tagged [delphi-10.1-berlin]

Delphi 10.1 Berlin is a specific version of Delphi released in April 2016.

Delphi 10.1 Berlin supports development of applications covering Windows 32-bit and 64-bit, 32-bit, 32-bit and 64-bit, and 32-bit. Windows applications may be built using either the framework or the (FMX) framework, whereas the rest of the supported platforms are built under the Firemonkey framework only.

Always use the tag alongside this tag.

580 questions
33
votes
6 answers

How to access private methods without helpers?

In Delphi 10 Seattle I could use the following code to work around overly strict visibility restrictions. How do I get access to private variables? type TBase = class(TObject) private FMemberVar: integer; end; And how do I get access…
Johan
  • 74,508
  • 24
  • 191
  • 319
16
votes
6 answers

Delphi - Correctly displaying a Message Dialog in FireMonkey and returning the Modal Result

I have a VCL application that I am porting to FireMonkey. One of the things that I ran into is that MessageDlg(...) is deprecated in FireMonkey. On digging a bit further, I understand that I have to use the FMX.DialogService.MessageDialog method. So…
Rohit
  • 909
  • 1
  • 9
  • 20
12
votes
2 answers

Why an application starts with FPU Control Word different than Default8087CW?

Could you please help me to understand what is going on with FPU Control Word in my Delphi application, on Win32 platform. When we create a new VCL application, the control word is set up to 1372h. This is the first thing I don't understand, why it…
Wodzu
  • 6,932
  • 10
  • 65
  • 105
11
votes
1 answer

Delphi "Supports" increments reference count on [weak] or [unsafe] interfaces

When I am using Delphi Berlin 10.1 [weak] (and [unsafe]) reference, the "Supports" function and "QueryInterface" both are incrementing the reference count when given an interface variable marked with the "weak" attribute (same behavior with "unsafe"…
Dave Olson
  • 1,435
  • 1
  • 9
  • 16
11
votes
1 answer

Updating Parse installation object removes it

I create an installation object using a REST API call like this : curl -X POST \ -H "X-Parse-Application-Id: ${APPLICATION_ID}" \ -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \ -H "Content-Type: application/json" \ -d '{ "deviceType": "ios", …
Edrean Ernst
  • 370
  • 1
  • 14
11
votes
2 answers

Is the [Ref] attribute for const record parameters useful?

With the latest Delphi version (Berlin/10.1/24), is the [Ref] attribute really necessary? I ask this because the online doc says: Constant parameters may be passed to the function by value or by reference, depending on the specific compiler used.…
user3942667
11
votes
3 answers

How to access a private field from a class helper in Delphi 10.1 Berlin?

I would like to use Gabriel Corneanu's jpegex, a class helper for jpeg.TJPEGImage. Reading this and this I've learned that beyond Delphi Seattle you cannot access private fields anymore like jpegex does (FData in the example below). Poking around…
stackmik
  • 151
  • 1
  • 10
10
votes
1 answer

Nested generic record

I just faced a strange compiler error when trying to define nested generic record. Nesting works fine with classes and interfaces, but not with records somehow. type TRec = record Value: T; end; TCls = class public Rec:…
Z.B.
  • 1,185
  • 9
  • 18
10
votes
4 answers

Typecasting Cardinal to Single

Both Cardinal and Single are 4 byte / 32 bit datatypes, but when I typecast them to each other I get an Invalid Typecast error in Delphi 10.1 (Berlin). lSingleVar := Single(lCardinalVar); I am NOT talking about converting between the two types, as…
Hans
  • 2,220
  • 13
  • 33
9
votes
1 answer

Must free TRegEx object after TRegEx.Create?

I have seen several Delphi examples of TRegEx usage like the following one in Delphi 10.1.2: try RegexObj := TRegEx.Create(REGEX_EXTRACTEMAILADDRESSES, [roIgnoreCase]); MatchResults := RegexObj.Match(ThisPageText); while MatchResults.Success…
user1580348
  • 5,721
  • 4
  • 43
  • 105
9
votes
2 answers

Delphi Data type too large: exceeds 2 GB in Berlin Update 2

I have a unit which is for both Delphi & Lazarus. In Lazarus the unit compiled without any exception but in Delphi it gives me Error Data type too large: exceeds 2 GB. Below is the code: unit UType; {$ifdef FPC} {$MODE…
shariful
  • 455
  • 1
  • 9
  • 21
9
votes
3 answers

How to detect whether scrollbar is at the very bottom?

It is easy to detect whether the vertical scrollbar of a TScrollBox is at the very top or not: IsScrollBarAtTop := ScrollBox1.VertScrollBar.Position = 0; But how can I detect whether the vertical scrollbar of a TScrollBox is at the very BOTTOM or…
user1580348
  • 5,721
  • 4
  • 43
  • 105
9
votes
2 answers

Delphi [weak] reference attribute produces "Invalid class typecast" when implementation is in more than one library

Delphi Berlin 10.1 adds [weak] references. Marco Cantu's Blog has some basics on it. For my test I created two COM libraries holding two automation object types. The container object holds a list of the content objects while the content objects…
Jasper Schellingerhout
  • 1,070
  • 1
  • 6
  • 24
9
votes
1 answer

Delphi 10 Seattle and 10.1 Berlin not able to debug COM DLL

I have a COM DLL project, and I am able to debug it (stop at breakpoints) in Delphi 2007 and XE8. However, it seems to not be possible for the IDE to stop at breakpoints in Delphi 10 Seattle or 10.1 Berlin. My steps of debugging: Change to DEBUG…
justyy
  • 5,831
  • 4
  • 40
  • 73
8
votes
1 answer

Delphi - Generics free

Having the following generics class TTuple = class protected fItem1: T1; fItem2: T2; public constructor Create; overload; constructor Create(Item1: T1; Item2: T2); overload; destructor Destroy; override; …
RBA
  • 12,337
  • 16
  • 79
  • 126
1
2 3
38 39