Questions tagged [delphi]

26176 questions
0

votes
0

answer
7

Views

How to get conhost.exe process id?

After doing some research and looking at the source code of ProcessHacker, it seems the way to obtain conhost.exe's process id is to use NtQuerySystemInformation. I wrote the following little program for testing purposes but, it isn't working and I don't see why. {$APPTYPE CONSOLE} {$TYPEDADDRESS O...
ScienceAmateur
1

votes
1

answer
39

Views

How to get the dynamic package from which a TPersistentClass comes from?

My application is built using runtime packages and loads them by using the LoadPackage function. Then it uses the GetClass function to obtain class types. var MyClass : TPersistentClass; begin if(LoadPackage('.\PackageA.bpl') = 0) then raise Exception.Create('Error loading PackageA.bpl'); if(LoadPac...
Fabrizio
1

votes
1

answer
77

Views

How to check if a subset is included into a set? [duplicate]

This question already has an answer here: How to compare sets of enumerated types 2 answers I have two set type variables and I need to check if the first is a subset of the second one. type TMyValue = (mvOne, mvTwo, mvThree); TMyValues = set of TMyValue; ... var V1 : TMyValues; V2 : TMyValues; beg...
Fabrizio
1

votes
1

answer
58

Views

Get possible and present values from a tkSet type using RTTI

Someone may already asked this question, but havent found it, so here it goes the problem: I want to parse a component's tkSet properties (Panel1 in our case), but I dont know how to do that properly. I was able to find the base enumerated type of the set using rContext.FindType(), but I'm almost su...
tcxbalage
1

votes
1

answer
88

Views

Assign event listener to dynamically created TPanel in Delphi

I created a TPanel component like this: procedure TVistaVehiculo.CrearMenu(Name: string); var Panel : TPanel; begin Panel := TPanel.Create(VistaVehiculo); Panel.Parent := VistaVehiculo.Sidebar; Panel.Width := VistaVehiculo.Sidebar.Width; Panel.Height := 40; Panel.Caption := Name; Panel.BevelInner :=...
nick
8

votes
1

answer
262

Views

Why is there a performance penalty for nested subroutines in Delphi?

A static analyzer we use has a report that says: Subprograms with local subprograms (OPTI7) This section lists subprograms that themselves have local subprograms. Especially when these subprograms share local variables, it can have a negative effect on performance. This guide says: Do not use nested...
afarah
0

votes
1

answer
8

Views

SetThreadDesktop: ERROR_INVALID_HANDLE

Why every time that code below is executed, SetThreadDesktop() fails with the following message: ERROR_INVALID_HANDLE The new desktop is created with success, then mean that have a handle opened. What's happening? program Project2; {$APPTYPE CONSOLE} {$R *.res} uses Windows, SysUtils; var _hDesk: HD...
BrowJr
1

votes
1

answer
435

Views

How to Track the progress of the Upload by NetHttpClient in delphi 10?

Now I will send the file to my server through the Nethttpclient component in delphi 10, but I don't know how to track the progress when uploading. If I download the file, I can get the progress through the event ReceiveData. There are not any other useful functions or events to do it, please kindly...
HenryXu
1

votes
1

answer
388

Views

Remove Meta Tag <meta Name=“GENERATOR” content="IntraWeb >on Delphi Intraweb

I need to remove or disable meta tag 'GENERATOR' from the header of Intraweb project. Need help on this. I'm using Rad Studio xe7.
Fatersoft Co
1

votes
1

answer
119

Views

How to Disable Downloading in Chromium CEF3

How to Disable Downloading in Chromium CEF3? I looked in the event onBeforeDownload but can't find a thing. All the parameters are constant. If I don't put any code in it will still continue to download. Thanks in advance
Ago
1

votes
1

answer
161

Views

How to check if an object is already destroyed or not?

I have created an object I passed it to somewhere else as parameter. Somewhere else has Free the object which out of my control. At the end my coding, I try to check if the object is valid then destroy it. The Assigned() method returned true (seems it is because the variable storing the object refer...
Eric Cheng
1

votes
2

answer
111

Views

How to send content with TIdHttp GET request?

I am trying to access a REST server that has an endpoint that uses the GET verb while it also requires json data to be sent in the body I am trying to accomplish that with an TIdHttp class, using the Get method. Right now I create a TStringStream with the json data, and then assign that stream to th...
R. Beiboer
1

votes
1

answer
134

Views

CreateProcess , WaitForSingleObject , Disable Input on Calling Application

I'm calling another Program which only displays a webpage like this : Problem : if I Create a Process with the Button , and while the Created Process is open , I click on a Checkbox on the calling form , I close the created process the Checkbox is checked . I tried to use the DisableTaskWindows(0)...
user1937012
1

votes
2

answer
86

Views

How to add items from an SQL query to a TListView

I want to add items from a query into a TListView using a for loop. But I get an error saying 'Too many actual parameters' from the ListViewShifts.Items.Add() line. What is the correct way of adding to the list from a query? Qry := TFDQuery.Create(DBConnection); Qry.Connection := DBConnection; Qry.S...
Wiliam Cardoso
1

votes
1

answer
74

Views

TIdSSLIOHandlerSocketOpenSSL and TLS protocol

I have a Windows desktop application developed in XE2 that pulls data from a remote server in JSON format. I use Indy 10 to manage this. The application was working fine until I received an email from the server provider people: '...the only protocol for securing the communication will be TLS 1.2. O...
pio pio
1

votes
1

answer
84

Views

TVirtualStringTree, position of the tree structure

The visual tree structure of the VirtualStringTree always sticks to the 1st column (the one with index = 0). When you change columns sequence by dragging a column header the tree may look weird (the image below). Is it possible to have the structure be seen always in the first visible column?
Molochnik
1

votes
1

answer
66

Views

Run as admin blocks the onDropped of DropTarget

I am trying to call this: MoveFileEx(pChar(src), pChar(dest), MOVEFILE_COPY_ALLOWED) The program completes the Copy part, but it doesn't Delete the files after copying. I thought maybe I should run my application with Administrative privileges, but the moment I do, the onDropped event of my DropTarg...
Ali Ahmadi
1

votes
1

answer
78

Views

How to get the complementary values for a Delphi sets type variable?

Starting from a set type variable like TAnchors: TAnchorKind = (akLeft, akTop, akRight, akBottom); TAnchors = set of TAnchorKind; I'm trying to get the complementary values. var Tmp : TAnchors; begin Tmp := [akLeft]; ... end; I'm expecting to get all values of TAnchors which are not in the Tmp varia...
Fabrizio
1

votes
1

answer
125

Views

TJpegImage: Internal bitmap not updated after applying JPEG compression

I want to convert a BMP to JPG, compress that JPG and the put back the compressed JPG into the original BMP. However, it won't assign the compressed image to the BMP. I always get the orignal image into the BMP. The code is below. To see the compression I set CompressionQuality = 1. This will liter...
Rigel
1

votes
1

answer
94

Views

Pointer of ^Pchar to array of PChar

when i migrate from Delphi 6 to Delphi 10.2 Tokyo i get error when i try to casting pointer of ^PChar to array of PChar type PServEnt = ^TServEnt; TServEnt = packed record s_name: PChar; // official service name s_aliases: ^PChar; // alias list s_port: Smallint;...
Deaa Darawsheh
1

votes
1

answer
98

Views

How to copy or reproduce the menu background gradient onto a bitmap using the Windows API?

I am trying (unsuccessfully) to copy/reproduce the background gradient of a Windows menu bar onto a bitmap. In the IconToBitmap function below, the FillRect (wishfully) uses the GetSysColorBrush(COLOR_MENU) in an attempt have it paint the menu background the way it is in Windows (unsurprisingly, the...
ScienceAmateur
1

votes
1

answer
72

Views

Delphi - Passing ALT keycodes to Excel

Delphi RIO - I have an Excel PlugIn written in Delphi. I am wanting to write a routine which converts cells which have multi-line contents to single line contents, basically replacing the line break with a space characters. I do this by replacing 'ALT 0010' to space characters. By this, I mean I...
user1009073
1

votes
3

answer
98

Views

How to fix 'Unable to find record. No key specified'?

I'am using a firebird 2.5 server to write in a Database file(BD.fbd). My delphi XE8 project has a Data module(DMDados) with: SQLConnection (conexao) TSQLQUery1 (QueryBDPortico_Inicial) + TDataSetProvider1 (DSP_BDPortico_Inicial) + TClientDataSet1 (cdsBDPortico_Inicial) TSQLQUery2 (QueryConsulta) (ju...
Johnny Arza
1

votes
1

answer
210

Views

Extend the event OnClick of all MenuItems in the screen to execute another block of code

I want to set an event OnClick to all TMenuItems on the screen to do what the event currently does, and another few lines of code. I am currently using Delphi 5 For example, say that I have a TMenuItem with the code: procedure TdesktopForm.MenuFoo1Click(Sender: TObject); begin ShowMessage(TComponent...
1

votes
2

answer
195

Views

check condition only if a condition is met within an if then

I have an example of a code and not sure what way is the best to use. For example I have if (x = 1) and (y = 2) and (if abc = false then check if z = 3) then begin ... check only if x = 1 if y = 2 if abc = false check z = 3. if abc = true then dont check z = 3 i am not sure if i am explaining the be...
echkart
1

votes
2

answer
111

Views

How to apply a keyboardhook on F1 within the application

For our application we created a Online Help where customers can look up stuff about our application. They can reach this in the menus but I also wanted to make it available by pressing the F1 key where ever you are within our application(since this is mostly used for Help within other applications)...
MonkeySleeve
1

votes
1

answer
125

Views

Updated graphics card does not update opengl32.dll

I've been trying to paint a texture on a square for the last week, but to no avail. The square draws but no texture. I'm using OpenGL, Delphi XE3 & Windows 10. The problem is the glGenerateMipmap function. My older version of opengl doesn't have the MipMap functions. So I replaced my card with...
Humanoid1000
1

votes
1

answer
63

Views

Send and receive simultaneously with TIdTCPServer

It is always advised to perform all the sending / receiving tasks in OnExecute event handler of TIdTCPServer, but I do not understand following: How to wait for a specific sequence on input and at the same time send some data to the same client? I need not a command-response sequence, but I need to:...
Paul
1

votes
4

answer
7.8k

Views

Storing values in TBlobField using sql

I want to store images into a database using SQL commands, I know other ways using TBlobField.LoadFromFile etc, but we make our own sql commands to update the database that's why I need to do this. How should I go about doing this?
Sandeep Chandra
0

votes
0

answer
7

Views

In term of performance is mormot rest connection is better than Oracle direct connection?

i work in a company on an a huge application made with delphi seattle(VCL) using direct connection to Oracle database server (2-tier), one of the experts proposed to migrate to the 3-tier architecture using mormot (or another library/components). One of his arguments that the new architecture (3-tie...
Soufiane Bra
1

votes
2

answer
6.1k

Views

delphi dateformat MM|dd|yy to MM/dd/yy error

I need to convert my current date which has the format: MM|dd|yy --- 12|09|11 I need to convert the format to: MM/dd/yy --12/09/11 The current system date separator is: -'|' I use the code as: var sDateOne : TDate ; begin Label1.Caption:=datetostr(now); {this display as 12|09|1...
PresleyDias
-1

votes
0

answer
21

Views

Improvement the code for fastreport in delphi

I use the following code for fastreport But the code does not work for me I have no idea how to correct the code and I'm not very skilled in working with Delphi I would appreciate it if you help me procedure TfrmLossRun.btnPrnLossClick(Sender: TObject); var s0,s1,s2 : String; begin with UserSession...
Jack Crowder
1

votes
1

answer
1.7k

Views

How to remove/delete particular member or element from static “Array of TPoint”?

I want to remove/delete particular member or element from static 'Array of TPoint'. How to do this?
Ganpat
-2

votes
2

answer
148

Views

Keeping Delphi DFM files in sync with their PAS files

I have a Delphi project with a lot of DFM files and matching PAS files. I can compile the PAS by just rebuilding the project, but how do I rebuild and keep the DFM files in sync with their PAS files? Right now I am getting a lot of '[Variable.field] does not have a corresponding component. Remove th...
Tom Kelly
6

votes
1

answer
136

Views

AttachConsole and 64 bit application

The WinAPI function AttachConsole always returns true when the program is compiled as 64-bit. First of all, I've declared the function as following: function AttachConsole(dwProcessId: DWORD): Bool; stdcall; external KERNEL32 name 'AttachConsole'; Then I call my function: if AttachConsole(DWORD(-1)...
Jens Borrisholt
1

votes
0

answer
112

Views

Delphi + iOS: how to implement UIContextualActionHandler in Delphi/FMX?

The iOS 11 SDK introduces two new UITableView methods for handling swipe actions: leadingSwipeActionsConfigurationForRowAtIndexPath trailingSwipeActionsConfigurationForRowAtIndexPath Objective-C: - (nullable UISwipeActionsConfiguration *)tableView:(UITableView *)tableView leadingSwipeActionsConfigur...
vitaliy-zh
1

votes
1

answer
432

Views

TStringGrid show (bcd) in delphi live binding

I connect TFDQuery with TStringGrid in live binding in delphi firemonkey apps. I tried to use filter in TFDQuery based on Editbox for searching purpose, and it's work just fine. but, whenever I clear the Editbox, one of my row in TStringGrid would show '(bcd)' as it's value like the pict below. what...
punk73
1

votes
1

answer
330

Views

FDPhysFBDriverLink behaving weirdly with VendorLib Path

I'm starting my first application with FireDAC and Firebird 3.0 and I'm having this weird problem with FDPhysFBDriverLink. Setting it up requires you to set VendorHome and VendorLib to get the driver link working... When I set them, the driver keeps adding '\bin\' to the end of my VendorHome path. F...
Nickolas Deluca
1

votes
0

answer
60

Views

Delphi Handle Android “Overview” button

Using Delphi Tokyo 10.2, is there a way to handle the OnClick event of the overview button (the button on the right of the android navigation bar)? I was thinking about something like the code above: procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState);...
LLuca
1

votes
0

answer
1.4k

Views

Delphi Indy error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure

I have been using Delphi XE Indy 10.5.7 OpenSSL 1.0.2n (https://indy.fulgan.com/SSL). When I try to execute code: procedure TForm1.Button1Click(Sender: TObject); var IdHTTP: TIdHTTP; URL, Str: string; SSL: TIdSSLIOHandlerSocketOpenSSL; begin URL := 'https://satsis.info/tv/wek/schedule_channel_3_wee...
vlad_n

View additional questions