913 questions
0
votes
1
answer
170
views
Printing and previewing simple drawing in Delphi
I am writing a set of routines to print my visual component (TStringGrid descendant) with an ability to see its print preview. The preview is done using TPaintBox. I want that drawing utilized my ...
0
votes
0
answers
65
views
C# Entity Framework COM Object accessed from Delphi Error [duplicate]
After installing Windows 11 Update 24H2, I have not been able to work with a COM Library developed with C# and accessed from Delphi. The failure occurs when I do a Where filter using a numeric ...
0
votes
2
answers
106
views
Saving HTML to local file from TWebBrowser denys access to html file
In Delphi XE7, I'm saving content of a TWebBrowser to a local HTML file:
function WB_SaveAs_HTML(WB:TWebBrowser; const FileName : string):boolean;
var
PersistStream: IPersistStreamInit;
Stream: ...
0
votes
0
answers
165
views
Why is TFDTable.FieldDefs.Update so slow?
I want to know the field definitions (field names, types, and sizes) for a group of PostgreSQL (it seems the database type does not really matter, it could be Oracle or SQL Server) tables using ...
1
vote
0
answers
81
views
Delphi service startup weirdness
Regular service written in Delphi XE7 (windows 10 22H2). In OnStart Event I create some objects, I read inifile etc.
StartType = stAuto.
Windows service set up: automatically.
When my service state is:...
1
vote
0
answers
133
views
Changing top level menu items font
I need to increase the font size of my menus (TMainMenu, TPopupMenu) and I cannot figure out how to do it correctly.
I thought I don't need to draw the menu items completely, so I just assigned ...
2
votes
2
answers
125
views
How to add Authorization header to SOAP request with THTTPRIO in Delphi XE7?
I use THTTPRIO in Delphi XE7 to get data from a SOAP server. I try the request with SoapUI without a problem.
POST /ClientServices/ClientServPort.svc HTTP/1.1
Accept-Encoding: gzip,deflate
Content-...
1
vote
1
answer
211
views
Delphi BDE with connection to Oracle access violation
I'm searching for a bug in a big legacy product. The end user only reports a program crash (no error messages).
When I start the program with attached debugger I get this:
Im Projekt XXXXX.exe ist ...
0
votes
1
answer
1k
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
105
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
280
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
425
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
125
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
475
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
172
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
1
answer
244
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
176
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
117
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
513
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
972
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
975
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: ...
2
votes
4
answers
2k
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
414
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
171
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
1k
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
201
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
2k
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
1k
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
348
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
173
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
2k
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
258
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
474
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
560
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
314
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
856
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
557
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
55
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
3k
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
367
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
8k
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
1k
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
151
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
244
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
1k
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
2k
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 ...
2
votes
1
answer
2k
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
362
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 : ...