Questions tagged [delphi-xe7]
Delphi XE7 is a specific version of Delphi released in September 2014.
909
questions
0
votes
1
answer
199
views
I'm getting "Socket Error # 10054 Connection reset by peer" in Indy using TIdHTTP to GET an HTTPS url
I have what seems to be a simple task - to make an HTTPS request, but I encountered an error:
Socket Error #10054 Connection reset by peer
Moreover, this error does not occur every time; out of 30 ...
2
votes
1
answer
77
views
Why the EN_PROTECT notification message is not sent to the RichEdit?
Using a runtime created TRichEdit descendant, I need to be notified when the EN_PROTECTED notification message is sent to the RichEdit.
As far as I know, it should be sent to the RichEdit wrapping any ...
1
vote
2
answers
147
views
How do I implement SSL in Delphi to connect to a REDCap API server?
I am trying to use XE7 to connect to an in-house REDCap server. REDCap has a detailed description of the API at https://education.arcus.chop.edu/redcap-api/ and a test server at https://bbmc.ouhsc.edu/...
0
votes
0
answers
146
views
How to connect Delphi mqtt client securely to an mqtt broker?
I want to use Delphi mqtt ssl client to connect to a secure mqtt broker for which I got a certificate (.crt). I have got an mqtt client component (pjde/delphi-mqtt on github) but don't know how to ...
0
votes
0
answers
89
views
Upload files with Delphi XE7 TRESTRequest without AddFile
Using RAD Studio XE7, I need to post files using the TRESTRequest component.
Unfortunately, I did not find a AddFile() method in this version of the component.
So, I have to find a solution that ...
1
vote
1
answer
243
views
Can Delphi Indy Ftp idFTP.GET Preserve the File's Created and Modified Date?
I would like to ask if Delphi Indy ftp idFTP.GET can preserve the file's created and modified date? If not, how can I accomplish this?
Thanks!
2
votes
0
answers
147
views
Inserting a row to Dataset has unsual delay at Delphi Alexandria 11.1 when load a big lookup Fields
Recently i have completed the migration of my company's project, from Delphi XE7 to Alexandria 11.1. After a couple of releases, some customers with bigger databases complained for delays at opening ...
0
votes
0
answers
258
views
Creating Index ,PK, tables at runtime using FireDAC (no SQL script)
I am trying do same with FireDac as following SQL:
CREATE TABLE [Franchises]([Franchise] TEXT(100) PRIMARY KEY ASC NOT NULL UNIQUE);
CREATE UNIQUE INDEX [IFran] ON [Franchises]([Franchise] ASC);
But ...
0
votes
1
answer
207
views
In Delphi XE7 when running a program in the IDE cannot create a log file, but it works when I run the created exe
When I start a program in the IDE, I use the following code to generate a log file. All of the paths are correct, checked with F8, but the log file is not output.
When I run the executable outside of ...
0
votes
0
answers
116
views
LoadVM Java VM with JNI - access violation
I have problem with loading Java VM. When I do LoadVM program gives access violation. On other computer it works fine. Here is some code that works but not on my machine:
uses jni;
var
Options: array ...
0
votes
1
answer
89
views
Reading thread's fields from synchronized event handler
Is it safe to read a thread object's fields from an event handler called by the Synchronize procedure?
For example:
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, ...
0
votes
1
answer
302
views
How to convert the numeric keypad dot-key into the DecimalSeparator?
In some applications, like Microsoft Excel, the dot-key from the numeric keypad (VK_DECIMAL) is automatically converted into the current DecimalSeparator.
I'm trying to implement the same feature but ...
-1
votes
2
answers
456
views
delphi convert set type to array of character
Currently in a legacy code I have a set which I want to convert to array of string so i can pass this as a parameter for existing method.
//Existing code to be used and converted
const
North = '...
0
votes
1
answer
400
views
Using TArray.Copy with generics arrays
I'm trying to copy all the items from a generic array to a new one using TArray.Copy (Note: In Delphi XE7 the function has no documentation).
class procedure Copy<T>(const Source, Destination: ...
1
vote
3
answers
897
views
OleContainer For MS Word
I have been using TOleContainer to display MS Word as an editor within my application. As from last week (3rd May 2022), the TOleContainer is not not embedding MS Word. Instead Word is opening as a ...
1
vote
1
answer
169
views
Displaying TRichEdit row and column in status bar
We are adding an ASCII editor to our application, and we are using TRichEdit in Delphi XE7. We need to display the Row and Column in the status bar, but have not found any code that works with the Key ...
0
votes
0
answers
156
views
Using TTaskBar before creating the application's main form
My application displays a "download form" with a progress bar while downloading updates and after finishing it destroys the "download form" and creates the application's main form.
...
2
votes
2
answers
752
views
How to forward a text with special characters in REST responses, in Delphi?
Please help. I'm trying to learn REST concepts and make the first programs using Delphi and REST objects. I came across a problem that I don’t know how to solve. In the database I have a test with ...
0
votes
1
answer
184
views
How to make a local array variable conditionally points to an open array parameter?
I'm trying to conditionally assign a local open array variable in order it points to a const open array parameter:
uses
System.Generics.Collections,
System.Generics.Defaults;
type
TArray = ...
4
votes
2
answers
1k
views
Converting a generic type variable to string
I'm trying to convert a generic variable of type T into string.
TMyTest = class
class function GetAsString<T>(const AValue : T) : string; static;
end;
...
uses
System.Rtti;
class ...
3
votes
1
answer
964
views
How to disable TWebBrowser context menu?
I have a frame which contains a TWebBrowser component and is used by some of my applications and I need to disable the TWebBrowser's default popup menu.
I found a solution which works at the ...
1
vote
1
answer
224
views
IDE crash at module jscript9.dll showing the welcome page and function's hints
I have Delphi XE7 installed on a Windows Server 2012 R2 (64 bit).
One week ago, it started crashing on startup, while displaying the welcome page with the following error message:
Firma problema:
...
0
votes
0
answers
168
views
TOpenPictureDialog and png_old extension
After adding a TOpenPictureDialog component, I noticed that, by default, the Filter property contains the "png_old" extension as its first element.
*.png_old;*.gif;*.gif;*.jpg;*.jpeg;*.png;*...
1
vote
1
answer
712
views
Displaying a disabled modal form
I'm trying to disable a TForm's descendant and showing it as a modal form.
procedure TForm1.Button1Click(Sender: TObject);
var
Frm : TMyForm;
begin
Frm := TMyForm.Create(nil);
try
Frm....
1
vote
1
answer
185
views
How to install Pervasive Direct Access components in Delphi-XE7
I have been trying for two days to install Pervasive PDAC components. I do everything according to Actian instructions. After selecting the required .bpl files, I keep on getting a message that the ...
2
votes
1
answer
298
views
How to adjust the column width to the content of a cell and allow to modify the width in Delphi XE7?
Good morning, I'm trying to adjust the width of the columns of a grid to its content but I also need that width can be modified manually. The grid is a TStringGrid and im using delphi XE7.
I am trying ...
4
votes
1
answer
376
views
Is WM_NCHITTEST supposed to be perpetually generated by Win10, at a frequency of 100's per second, even if mouse is idle?
I'm experiencing a strange behavior with WM_NCHITTEST messages.
In summary, what happens is that as soon as I have the mouse over the target (ie: Hooked) control and leave the mouse still (or idle), I ...
1
vote
1
answer
236
views
Exception when trying to execute a query from pascal
The following function takes the cuits (the cuit is like social security number) from a grid and inserts them into a temporary table. I'm using Delphi XE7 and Firebird 2.5.
function ...
2
votes
1
answer
434
views
Why does TJSONObject.AddPair results Self?
I've noticed that TJSONObject.AddPair functions results Self instead of the newly created object:
For example, in System.JSON unit I see the following code:
function TJSONObject.AddPair(const Str: ...
1
vote
2
answers
300
views
Setting bounds for dynamic arrays
Static arrays allow to define their low and high bounds:
StaticArray : array[5..7] of Integer;
I don't know how to do the same thing with dynamic arrays at runtime.
For example, if I need to copy the ...
0
votes
0
answers
50
views
String helper's Split function doesn't consider empty spaces after the last delimiter [duplicate]
The TStringHelper's Split function doesn't consider the last element,
ShowMessage(
IntToStr(Length('|||'.Split(['|'], None))) + sLineBreak +
IntToStr(Length('a|b|c|d'.Split(['|'], None)))
)...
1
vote
1
answer
2k
views
Converting a string to Cardinal / UInt32
I need to convert a string to an unsigned 32 bit integer (Cardinal).
In System.SysUtils unit there are many useful functions like:
StrToInt
StrToInt64
StrToUInt64
But I can't find any StrToCardinal, ...
1
vote
1
answer
2k
views
Delphi XE7- Convert memo to UTF8
How can I convert my memo.text to UTF-8 and sent it to my e-mail via TIdMessage component? I used this function but it does not work properly...
function TForm1.EncodeAsUTF8(UnicodeStr: string): ...
1
vote
1
answer
283
views
Centralizing a TField's Size value
After enlarging a database table's VarChar field from size 20 to size 50, I have to update the Size property of hundreds of design-time created TFields and I would like to do that once for all (I don'...
2
votes
1
answer
5k
views
How to get RGB values for a system color? [duplicate]
I've always used GetRValue, GetGValue and GetBValue functions (From Winapi.Windows unit) for extracting the RGB values for a TColor.
Unfortunately, the same approach does not seem to be good for ...
1
vote
1
answer
739
views
Changing an image's Exif tag "Orientation"
I'm trying to change the Exif tag "Orientation" (0x0112) for a given image by code.
Here I've found a working example about reading but I'm failing in writing the same tag.
uses
GDIPAPI, ...
2
votes
0
answers
129
views
Calling anonymous function from a pointer
I get an access violation while trying to call an anonymous method from a Pointer variable
var
Proc : TProc;
Pt : Pointer;
begin
Proc := procedure
begin
ShowMessage('Hello World');
end;
...
0
votes
1
answer
209
views
Timer is lagging in the UI
I have a TTimer component that is used for stopwatch functionality, and shows data in a TEdit as 'h:m:s --- 0.00 dollars', as follows:
procedure TBillardApp.Timer1Timer(Sender: TObject);
begin
sec:=...
2
votes
0
answers
912
views
Reading a text file written with a different default encoding
I have a text file which has been written using TStringStream without explicitly pass an encoding. This file has been generated from an Italian computer.
var
Stream : TStringStream;
begin
Stream :=...
3
votes
1
answer
1k
views
How to detect clipboard text changes?
How can my application receive a notification when the clipboard text changes?
For example:
I would to enable/disable a paste button and setting its Hint property in order to display the clipboard's ...
1
vote
1
answer
1k
views
Extracting the ProductVersion from the compiled executable/package
In the Project Options, there are some informations that can be set for the compiled file, like:
CompanyName
FileDescription
FileVersion
InternalName
LegalCopyright
LegalTrademarks
OriginalFilename
...
1
vote
2
answers
2k
views
How to check if a RegEx matches all the target string?
I need to check if a regex pattern matches with all the target string.
For example, if the pattern is '[0-9]+':
Target string '123' should result True
Target string '123' + sLineBreak should result ...
3
votes
2
answers
260
views
'Cannot capture symbol' error using an open array param inside anonymous method which is passed to another function
I'm trying to use an array of Integer parameter inside an anonymous method passed as parameter to another function:
type
TAnonymousMethod = reference to procedure();
procedure SubTest(AMethod : ...
1
vote
1
answer
334
views
W1035 Return value of function 'Test' might be undefined unexpectedly appears after adding a try-finally block
I have an unexpected W1035 on compiling:
[dcc32 Warning] Unit1.pas(40): W1035 Return value of function 'Test'
might be undefined
function CheckFn() : Boolean;
begin
Result := True;
end;
function ...
0
votes
0
answers
100
views
Why does W1036 occur when using a variable assigned under the same immutable condition?
I have to execute optional code lines at the start and at the end of a block of code.
procedure Test(const AInitializeFlag : Boolean);
var
Flag : Integer;
begin
if(AInitializeFlag) then
Flag :=...
0
votes
2
answers
1k
views
Assigning a Pointer to a NativeInt causes E2010 Incompatible types
Assigning a Pointer to a NativeInt variable causes an E2010 on compiling:
var
Test : string;
Ptr : Pointer;
LocTag : NativeInt;
begin
Test := 'Hello World';
Ptr := @Test;
LocTag := Ptr;
...
1
vote
0
answers
229
views
Is passing a (Unicode) string to a WideString parameter safe?
Is it safe to pass a Delphi (Unicode) string to a procedure as a parameter of type WideString?
procedure Test;
var
S: string;
Html: string;
begin
S := '...'; // may contain anything a Unicode ...
2
votes
1
answer
666
views
Detecting changes in an editable TWebBrowser
I'm loading an HTML local file into TWebBrowser as follows:
procedure TForm1.FormCreate(Sender: TObject);
begin
WebBrowser1.Navigate('file:///C:\Tmp\input.html');
end;
In the TWebBrowser....
1
vote
0
answers
570
views
Editing and saving local HTML file using TWebBrowser
I'm trying to load a local HTML file in TWebBrowser, edit the content and save it.
I've read some suggestions from this article and tried as follows:
1) Loading the document:
procedure TForm1....
0
votes
2
answers
3k
views
Delphi: Display a PDF in a TWebBrowser
I need to display a pdf file into a TWebBrowser object.
WebBrowser1.navigate(PDFFileName) works fine.
But i would like to load the pdf file from a TMemoryStream.
I have a base64 encoded PDF file ...