Questions tagged [delphi-xe2]
Delphi XE2 is a specific version of Delphi. Delphi XE2 was released on September 1, 2011 and is available as a standalone product or as part of RAD Studio XE2.
delphi-xe2
2,598
questions
153
votes
1
answer
23k
views
SOAP server and client application VCL+indy demo for Delphi XE?
Delphi used to include a demos folder for web Services, but no longer seems to include this.
I just tried the Delphi 7 demo projects (SOAPDMServerWAD, a server with almost no UI at all, and ...
147
votes
2
answers
8k
views
How to create "No Activate" form in Firemonkey
In XCode by adding these methods to your NSView subclass can prevent the window from becoming active when clicking on it:
- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent )theEvent {
return YES;...
99
votes
1
answer
2k
views
Required tags not present when using Delphi XML Data Binding Wizard
I am using the XML Data Binding Wizard in Delphi XE2.
The schema has required tags of this type:
<xs:element name="MyReport" type="MyReportType" />
<xs:complexType name="MyReportType">
&...
73
votes
2
answers
2k
views
Webview not displaying in MacOS using Delphi XE2
I have started to convert the Webview interfaces to be consumed in Delphi. I have managed to get the webkit library to load, and the interface methods that is called appears to work correctly, ...
67
votes
1
answer
2k
views
BcdDivide function behave differently in Delphi XE and XE2
FmtBcd.pas has been extensively revised rewritten in Delphi XE2. In one of my projects, I have a case that uses a division operation on two Bcd values, but the two versions yield different results. In ...
58
votes
4
answers
2k
views
Remote debugging with XE2 - display of strings
I'm remote debugging a large app between DElphi XE2 (update #4) and a Windows XP target. PAServer is running on the target and the application works fine and stops at breakpoints (you would NOT ...
54
votes
2
answers
7k
views
Is COM broken in XE2, and how might I work around it?
Update: XE2 Update 2 fixes the bug described below.
The program below, cutdown from the real program, fails with an exception in XE2. This is a regression from 2010. I don't have XE to test on but I'...
54
votes
4
answers
1k
views
Midi Timing Issues with Delphi ASIO VST and MiniHost
I'm coming from a background of using MSC* MidiSequencer for a Delphi XE2 project and have been playing with DelphiASIOVST this weekend on the off chance the MIDI may be stable enough to use as my ...
51
votes
0
answers
2k
views
How do I write a TDBCtrlGrid VCL Style custom class?
There are lots of questions here about XE2 VCL Styles and custom colors for Buttons, Panels, edits, etc, and VCL Styles. As much as I wish the existing questions covered it, they don't... So DB ...
45
votes
1
answer
1k
views
Compiler bug when using generics and forward declaration in Delphi XE2
I started project on Delphi 2010, then migrated to XE and now I try to migrate to XE2.
After compiling in XE2 (Update 4 Hotfix 1), unit tests began fail with AV.
After some debugging, it became clear ...
44
votes
5
answers
8k
views
TThreadedQueue not capable of multiple consumers?
Trying to use the TThreadedQueue (Generics.Collections) in a single producer multiple consumer scheme. (Delphi-XE).
The idea is to push objects into a queue and let several worker threads draining ...
39
votes
6
answers
108k
views
Using Case Statement with String
Say i have a string
'SomeName'
and wanted the values return in a case statement. Can this bedone? Can strings be used in a case statement like so
Case 'SomeName' of
'bobby' : 2;
'tommy' :19;
...
38
votes
1
answer
5k
views
Firemonkey ScrollBox Bug
We are experiencing what seems to be a strange bug in Firemonkey's ScrollBox component (since TGrid inherits from TScrollBox it also affects all grids). On some ouf our development machines, ...
38
votes
1
answer
1k
views
Is there a trick for using TSQLMonitor with a TSQLConnection that uses the new ODBC dbExpress driver?
I have been testing the new ODBC dbExpress driver that ships with Delphi XE2, and have noticed that the TSQLMonitor does not seem to work. Thinking that I may have configured the component incorrectly,...
36
votes
3
answers
35k
views
What are the reasons to use TArray<T> instead of Array of T?
I'm migrating a legacy Delphi application to Delphi-XE2, and I'm wondering if there's a good reason to replace the arrays defined as Array of MyType to TArray<MyType>. So the question is what ...
36
votes
3
answers
3k
views
Memory leak in the Win64 Delphi RTL during thread shutdown?
For a long time I’ve noticed that the Win64 version of my server application leak memory. While the Win32 version works fine with a relatively stable memory footprint, the memory used by the 64 bit ...
35
votes
2
answers
152k
views
Why does CreateProcess give error 193 (%1 is not a valid Win32 app)
The code below fails to start documents. I get error 193 (%1 is not a valid Win32 app). Starting executables work fine.
The files are properly associated, they start the corresponding app when double ...
35
votes
2
answers
8k
views
Firemonkey (FMX) bitmap and colours
Assume I have a small bitmap in Firemonkey (say 32x24 pixels). So I put a TImage onto a form and in the constructor there is this code:
Image1.Bitmap.Create(32, 24);
if Image1.Bitmap.Canvas....
35
votes
1
answer
8k
views
How to build using MSBuild and Delphi XE2
I've been building projects using Delphi XE and MSBuild using the following simple example which works fine in a batch file. Project1 is an empty project created using 'File | New | VCL forms ...
33
votes
8
answers
40k
views
How to open an URL with the default browser with FireMonkey cross-platform applications?
Usually, I use: ShellExecute(0, 'OPEN', PChar(edtURL.Text), '', '', SW_SHOWNORMAL);
How can I have the same behaviour (opening a link in the default browser), on all platforms (Windows and OSX)?
32
votes
1
answer
2k
views
Which language elements can be annotated using attributes language feature of Delphi?
Delphi 2010 introduced custom attributes which can be added to type declarations and methods. For which language elements can a custom attribute be used?
The examples which I have found so far ...
31
votes
2
answers
1k
views
Howto add menu item to Mac OS Finder in Delphi XE2
I'm working on Delphi XE2 application targetting Mac OS and Windows. And I want to have integration into context menu. For windows this is simple task. But for Mac OS I dont know how to do this.
I've ...
27
votes
4
answers
11k
views
Pass record parameter without declaring it first as a variable
If I am trying to call a procedure which has a record type (not object) as a parameter, is it possible to somehow pass details of that parameter "inline" without having to declare a variable of that ...
26
votes
6
answers
5k
views
Delphi XE2 64-bit extremely slow runtime performance on string routines
I'm porting some applications from 32 to 64 bits delphi, which do a lot of text processing, and noticed an extreme change in processing speed. Did some tests with a few procedures, for example, this ...
25
votes
3
answers
31k
views
Design-time package fails to build - File not found: 'Graphics.dcu'
In Delphi XE2, I have a single control in a pair of design/run time packages. Originally, everything was working fine. I've built each of them many times already. Suddenly without warning, the design ...
25
votes
6
answers
9k
views
Delphi XE2: Possible to instantiate a FireMonkey Form in VCL application?
Prior to Delphi XE2, we have VCL only to create GUI apps. Delphi XE2 states that:
Caution: FireMonkey (FMX) and the Visual Component Library (VCL) are
not compatible and cannot be used in the ...
25
votes
1
answer
1k
views
Delphi XE2 VCL styles, updating caption blocks other controls invalidation
Found a glitch with VCL styles: when you update the form caption, other controls previously redrawn within the same procedure don't get repainted, and you are forced to call Repaint, losing valuable ...
25
votes
1
answer
3k
views
Delphi XE2: Debug a 64 bit dll through a 64 bit app
Has anyone had success in debugging a 64 bit dll by running/attaching to a 64 bit application? I have Delphi code for both the application and the dll. I can debug the application in 32 bit and 64 ...
24
votes
8
answers
44k
views
How to bring my application to the front?
I know all the reasons why it is a bad idea. I dislike it if an application steals input focus, but this is for purely personal use and I want it to happen; it will not disturb anything.
(for the ...
24
votes
9
answers
40k
views
How to count number of occurrences of a certain char in string?
How can I count the number of occurrences of a certain character in a string in Delphi?
For instance, assume that I have the following string and would like to count the number of commas in it:
S := ...
23
votes
8
answers
9k
views
How can I automate getting the date of build into a constant visible to my code?
I would like to define in my code a constant holding the date on which the executable was built. I would naturally like to automate that process.
I know that I can write a pre-build script using, for ...
23
votes
1
answer
3k
views
With FireMonkey and its cross-platforms, where should I store my application data?
Usually, with Windows, I save my application's data in the user folder (%appdata%).
For that, I use the function ExpandEnvironmentStrings which is linked to Windows to get the folder I need, and I ...
23
votes
2
answers
3k
views
What can I do about maximized, styled windows, which show their borders on adjacent monitors?
On a multi-monitor system, a "blank" VCL application maximizes fine, but the same application with styles enabled (and one chosen as default) maximizes incorrectly. What I'm seeing is the right-hand ...
21
votes
5
answers
36k
views
Is there an easier way to do boolean conversions?
I have used this scenario many times in nearly all my projects, when I'm doing some sort of data conversion, when it comes to booleans, I kinda get a little lost when it comes to making it simple. ...
21
votes
1
answer
3k
views
How do I change the way the RAD Studio (2010 and later) IDE formats my code?
How do I configure the RAD Studio IDE to format my code with begin on either the same or next line when I use the Format Source option?
One of the most commonly debated preferences is the position of ...
21
votes
4
answers
5k
views
What does "Packed Now Forces Byte Alignment of Records" mean?
The What's New for Delphi XE2 contains the following.
Packed Now Forces Byte Alignment of Records
If you have legacy code that uses the packed record type and you want
to link with an ...
21
votes
1
answer
5k
views
How can a designer design a firemonkey style
Firemonkey brings us the ability to add styles, vector graphics, bitmaps, effects, animations etc to our apps. But I'm no designer, so I'll need to hire one to do the fancy work. But as far as I can ...
20
votes
6
answers
42k
views
How to convert Local time to UTC time in Delphi? and how to convert it back from UTC to local time?
I'm using Delphi and I'm trying to store records using UTC datetime in my database and then restore it back when a client reads it in his local datetime ? any idea how to do this forth back conversion ...
20
votes
3
answers
13k
views
How to define application version in one place for multiple applications?
We have a system which consists of numerous applications. All applications have their version changed at the same time. Currently, when we release a new version, we have to manually open the project ...
20
votes
6
answers
14k
views
Reduce exe file
Using Delphi (or in general any tools, if exist of course), is it possible to reduce size of an exe file, removing all code that not is used but that is present there?
(for example, a function or ...
20
votes
1
answer
33k
views
Example for using Generics.Collections.TObjectDictionary
The Delphi XE2 online help (as well as the Embarcadero DocWiki) is very thin on the documentation of TObjectDictionary (or I am too stupid to find it).
As far as I understand it, it can be used to ...
20
votes
1
answer
3k
views
Why cannot take address to a nested local function in 64 bit Delphi?
AS. since closing related questions - more examples added below.
The below simple code (which finds a top-level Ie window and enumerates its children) works Ok with a '32-bit Windows' target platform....
20
votes
2
answers
2k
views
Delphi XE2: Is it possible to create Mac GUI applications without FireMonkey?
Using Delphi XE2, is it possible to create a Mac GUI application without using FireMonkey for the GUI? If so, what could be used and how would one go about it?
20
votes
1
answer
7k
views
Need bidirectional LiveBindings between a control and an object
In Delphi XE2 LiveBindings, I need to bind a VCL control of any type to a property of any type on an arbitrary (non-component) object. I can do this unidirectionally. But I need to do it ...
19
votes
2
answers
11k
views
How do I parse a web URL?
I need to be able to break a URL down into different segments. Take this path for example:
http://login:[email protected]:8080/some_path/something_else.html?param1=val¶m2=val#...
19
votes
7
answers
4k
views
Setting up a large software system in Delphi
We have a software package which is about 16 years old. It's gone through just about every version of Delphi (besides .NET ones). Over the years, things have become very confusing when it comes to ...
19
votes
4
answers
15k
views
DCC Hint: H2161 Warning: Duplicate resource: Type 24 (user-defined), ID 1; File resource ... kept; file ...\WindowsXP.res resource discarded
Get the following error while linking my project in Delphi XE2. Recreating of .dproj file doesn't help.
[DCC Hint] H2161 Warning: Duplicate resource: Type 24 (user-defined), ID 1; File resource <...
19
votes
5
answers
51k
views
What is the best way to program a delay in Delphi?
A Delphi application that I'm working on must delay for one, or sometimes two, second(s). I want to program this delay using the best practices. In reading entries about Delphi's Sleep() method on ...
19
votes
3
answers
9k
views
How to disable VCL styles in Delphi
I am using the new VCL styles system in Delphi XE2. It works great, but I wish to disable it for a particular form that has a number of images on it (a splash/about form). Problem is I can't seem to ...
19
votes
4
answers
6k
views
Firemonkey version of VirtualTreeView
Does anyone happen to know if there is a Firemonkey version of the popular VirtualTreeView in preparation? Also, has anybody collected some experiences with porting custom controls to Firemonkey and ...