Delphi

59K

Solutions

17K

Contributors

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.

Share tech news, updates, or what's on your mind.

Sign up to Post

On a TForm I have a TComboBox component
I want to programmatically "click" on it so that the user has to select an item in the list
TComboBox.Click is refused by the compiler
Any other way ?
0
CompTIA Cloud+
LVL 12
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

In my Delphi application, I have a TMemo on a form
I put some text in it, but quiet long (wordwrap = true)
That's not a problem, user can go down in the text but sometimes the beginning of the text is not shown at the top right of the TMemo
How can I have text visible from the beginning of it
0
I have two forms shown in my application
Says FormA and FormB
How can I programmatically do to have FormB becoming visible when it is "behind" FormA ?
Thanks
0
I want to move from FTP to HTTPS due to Firewalls being nasty to FTP.
For HTTPS I will need a SSL Certificate.
   Can I get free valid certificates anywhere ?
   Should I distribute my certificates while deploying my Application ?
I use Delphi (ICS HTTPS component) and my application runs on Win OS.
I have developed a backup application which is installed on every machine of my customers.
The HTTP Server will only be installed on the Destination machines and monitoring machine.
0
I´m  installing Delphi 5 Application on virtualbox running windows XPSP3. This old application use MDB database. Now I´m facing this error when starting the App.
Invalid configuration parameter on ALIAS: DATABASENAME

How can I solve it ?
0
Using Delphi XE8 I get errors all the time when compiling a project:

1. [CreateAndroidManifestFile Warning] android:hardwareAccelerated attribute not found. Please review AndroidManifest.template.xml
2. [PAClient Error] Error: E2312 Unable to execute '"C:\Users\Public\Documents\Embarcadero\Studio\16.0\PlatformSDKs\android-sdk-windows\build-tools\21.1.2\Aapt.exe" package -f -M "D:\myprograms\NEW\Delphi\Test\Android\Debug\Clicked\AndroidManifest.xml" -F "D:\myprograms\NEW\Delphi\Test\Android\Debug\Clicked\bin\Clicked-unsigned.apk" -I "C:\Users\Public\Documents\Embarcadero\Studio\16.0\PlatformSDKs\android-sdk-windows\platforms\android-21\android.jar" -S "D:\myprograms\NEW\Delphi\Test\Android\Debug\Clicked\res" -A "D:\myprograms\NEW\Delphi\Test\Android\Debug\Clicked\assets" "D:\myprograms\NEW\Delphi\Test\Android\Debug\Clicked\library" "D:\myprograms\NEW\Delphi\Test\Android\Debug\Clicked\classes"' (Error 1)

[PAClient Error] Error: E2312 D:\myprograms\NEW\Delphi\Test\Android\Debug\Clicked\AndroidManifest.xml:1: error: Error parsing XML: not well-formed (invalid token)

How to solve the problems with this Manifest XML? I didn't input Api keys and all other keys at testing stage. What needs to be done to get rid of this Manifest problems?

Thanks for help.
0
What is the best way to communicate between a Windows Service application and a UI Application within the machine.
Currently I am writing into a SQL lite database and reading every second in both applications.
My Service application has Socket Communication for inter machine, I do not want Sockets on UI (to avoid Firewall blocking).
IPC at times gives problems when the users are different (Local System and Standard user)
I use Delphi Seattle on Windows
0
Hi Experts,
I would like to track the number of pages printed via a printer.
Ther are multiple printers installed, including pdf printer.
I need to get the number of successfully printed pages (number of copy / number of pages) from a specific printer.
Documents are printed by Fastreport . Have you any delphi example, how to realize this?
Thanks in advance, Tom
0
Hello,

I have an FMX application.
I have a problem with anonymous method, please share your strategy, how to workaround this.

I would like to use this as:

If  MyFunction1 <>'' Then
  MyProcedure2;

.....

Function MyFunction1:String;
Begin
  MyForm:=TMyForm.Create(Nil);

  With MyForm Do
   Begin
      Query1.Sql.text := 'select * from xxx;'
      Query1.Open;
     ....
     showing the query in grid etc.
   End;

  MyForm.ShowModal(
   procedure(ModalResult: TModalResult)
   begin
     if ModalResult = mrOK then
      Begin
         // Here I need to give back the autoincrement field of the selected record, but how? Result is not available here

      End;
   end);

End;

Thank you very much for your help!
0
I have been using Delphi 7 in Windows 10 for quite awhile.

I use ESET Internet Security as my anti-virus/anti-malware protection.

A recent update in ESET has caused problems with D7 - when I run a program from the IDE, the program never starts - it appears as though ESET is blocking the "integrated debugger" from attaching to the process.

I can disable all protection and everything works.

I'm looking for alternate solutions - something I might be able to add as some type of exception rule in the anti-virus to allow the integrated debugger to work.

Is the integrated debugger actually "integrated" in delphi32.exe, or is it called by the IDE?  That is, is there a DLL or exe that can be identified as exception to anti-virus program?

TIA.

EdB
0
Become a Certified Penetration Testing Engineer
LVL 12
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

I have a backup program during which I want to avoid backup of 'Recycle Bin' , 'C:\Windows\' etc.
I get all the special folders using SHGetSpecialFolderPath but I cannot get Recycle Bin ( CSIDL_BITBUCKET) .
I know it is a virtual folder but I need it specific to a Drive say for C: or D: etc
SHGetSpecialFolderPath  for CSIDL_BITBUCKET returns ''
0
Hello,

I have a Delphi project (Delphi Seattle) which uses a dbf file as a resource.
It works very well.
I use this code:

RF_SaveResourceAsFile('Dbf_abc', 'RT_RCDATA', ExtractFilePath(ParamStr(0)) + 'abc\' + 'ABC.DBF');
....
procedure RF_SaveResourceAsFile(const ResName: string; ResType: pchar; const FileName: string);
begin
  with TResourceStream.Create(hInstance, ResName, ResType) do
   try
     SaveToFile(FileName);
   finally
     Free;
   end;
end;

Open in new window


However I have a new project which needs exactly the same function.
But here when I want to use I get "Resource Dbf_abc not found" exception.

This is what I did:
-I added the resource to the project (I tried to to this both from Resources and Images and manually , editing the .rc file)
-I included the resource
 ( I  tried {$Resource myprogram.RES} and {$R 'myprogram.res' 'myprogram.rc'} both at the dpr and the main.pas (separately and together)

What am I missing? If I open the .res file I can see the definition of the dbf file so it was compiled ....

Thank you very much!
0
how could i make Twsocket send strings in utf-8 encoding using sendstr ?
0
I am trying to debug a custom component by using delphi to do it.

using : Delphi Tokyo 10.2.2, Windows 7.



this is my component source:

unit pvDBLookupCombo;

interface

uses
  System.SysUtils, System.Classes, Vcl.Controls, System.UITypes,
  RTLConsts,
  cxControls, cxContainer,
  cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxLookupEdit, cxDBLookupEdit,
  cxDBLookupComboBox, strUtils, variants
  , Data.DB;

type

  TProVDBLookupEditProperties = class(TcxLookupComboBoxProperties)
  private
       fSearchSQL : tStringList;
  public
    constructor Create(AOwner: TPersistent); override;
  published
     property ClearKey default 27;
     property GridMode default true;
     property ImmediatePost default True;
     property ValidationOptions default [evoRaiseException, evoShowErrorIcon];
    property SQL : tStringList read fSearchSQL write fSearchSQL;
  end;

  TProVDBLookupComboBox = class(TcxDBLookupComboBox)
  private
    { Private declarations }
//     FSearchKind: TSearchKind;
     fIsRequired : boolean;
     fSearchDataSource : tDataSource;

  protected
    { Protected declarations }
//    procedure DoOnNewLookupDisplayText(const AText: string);override;
  public
    { Public declarations }
      constructor Create(AOwner: TComponent); override;
      class function GetPropertiesClass: TcxCustomEditPropertiesClass; override;
  published
    { Published declarations }
    //property searchKind : tSearchKind read fSearchKind write fSearchKind;
    

Open in new window

0
Hi,

I want to add optional two-factor authentication during login into my Delphi win32 application.
Using: Delphi 10.1 Berlin Enterprise
User logs in using normal username and password. On his mobile phone he receives an authorisationcode which he needs to enter in the application.

What would be the easiest way to set this up?
A very basic example would be appreciated.
0
Hello Guys,

How can I load a XML file ( the contents) into a field in my MSSQL table?

I only want the texts that inside the file and not the binary file

My field in my table is a text field.

thanks
Alex
0
I am working for a company now for a couple of weeks. The build process is done mostly manually and takes several hours spread over several days. The languages in use are C#, COBOL, Delphi, Visual Basic 6, and of course the database with T-SQL. For the version control, we use Apache Subversion (SVN), except for COBOL code and the documentation, which is kept in Microsoft Visual SourceSafe (VSS). I have the idea to improve the process using a continuous delivery tool. Do you think that Jenkins would do the job?

Thank you for your reply.
0
in Implementing Web Application Proxy in Windows Server 2012 ,can i publish exes and little bit internal Software's like ( notepad,excel,adobe reader..our internal delphi related exes).
0
Hi Experts,
I have an issue in column sorting in a grid which is a dev express grid ( tcxgrid).

So in the column if i have records eg ABCDE, A ABCDE, AB ABCDE etc then it should sort as A ABCDE, AB ABCDE, ABCDE.

Is there any way to do this?
0
Learn SQL Server Core 2016
LVL 12
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

I wrote a web service in delphi (10.2.3), when I try to import the wsdl generated by the service with wsimport I get some errors like:

  [ERROR] undefined simple or complex type 'soapenc:Array' 

Open in new window


 How can I avoid these errors?

Attached the wsdl file of the service
 wszeus.wsdl.txt
0
Is there a clean way to determine whether a particular file is locked in Windows?
Before updating my program I want to be sure no files in the installation folder are in use. This to prevent the update from failing.

I tried the following code:

function IsFileInUse(FileName: TFileName): Boolean;
var
  HFileRes: HFILE;
begin
  Result := False;
  if not FileExists(FileName) then Exit;
  HFileRes := CreateFile(PChar(FileName),
                         GENERIC_READ or GENERIC_WRITE,
                         0,
                         nil,
                         OPEN_EXISTING,
                         FILE_ATTRIBUTE_NORMAL,
                         0);
  Result := (HFileRes = INVALID_HANDLE_VALUE);
  if not Result then
    CloseHandle(HFileRes);
end;

Open in new window


and this one:

    Result := False;
    try
      fHandle := FileOpen(inFile, fmExclusive);

      if fHandle = -1 then
        result := True
      else
        FileClose(fHandle);
    except
      Result := True;
    end;

Open in new window


and this one ...

     
      try
        if FileExists( inFile ) then
        begin
          try
            fs := TFileStream.Create( inFile, fmOpenReadWrite or fmShareExclusive );
            Result := False;
          finally
            fs.Free;
          end;
        end;
      except
        Result := True;
      end;

Open in new window



But all three have the same problem: By testing whether the file is locked, it is  (sometimes) locked by the test itself.
Is there a better way to check whether a file is locked, or will every solution result in the same problems?
0
I'm trying to read an xml response from a api but I keep getting the following error:


How can I read the xml data if the response looks like this:
<status>success</status><statusmsg>online</statusmsg><vmstat>online</vmstat><hostname>quantum.vps</hostname><ipaddress>xxx.xx.xx.xxx</ipaddress>

Open in new window


My current code:
procedure TfrmMain.btn1Click(Sender: TObject);
var
  httpclient: TIdHTTP;
  doc: TXMLDocument;
  data: IXMLNode;
begin
  httpclient := TIdHTTP.Create(nil);
  try
    doc := TXMLDocument.Create(nil);
    try
      doc.XML.Text := httpclient.Get('https://site.com/api.php?action=status'); //Modified URL for experts exchange
      doc.Active := True;
      data := doc.DocumentElement;
      lbl1.Text := data.ChildNodes['status'].Text;
    finally
      doc.Free;
    end;
  finally
    httpclient.Free;
  end;
end;

Open in new window

0
In Delphi I'm looking for a way to clone a two forms (one that has an ancestor that inherits components and settings accordingly) into a new single form that has no ancestor requirement.

To try and describe this - let's say that I have two forms:

FORMANCESTOR contains 3 buttons on it sitting on a Panel. The captions on these buttons are set in FormAncestor, and Buttons are called BTN1, BTN2 and BTN3.

FORMCHILD is a descendant of FormAncestor so the panel with the 3 buttons inherits automatically and shows on FORMCHILD.  But FORMCHILD has BTN3's caption altered, and has a new 4th Button added to FORMCHILD.

What I would like to do is create a new form called FORMINDEPENDENT which has the 4 buttons and Panel, and inherits from TForm as opposed to TFormAncestor

I was just wondering if there is a standard way / correct method to merge / migrate / clone from decedents as per the above so that I have a new independent form that doesn't need to reference any ancestors and can just be a descendent directly from a TForm?

Thanks

Adam
0
I had this question after viewing TAdvStringGrid:  Cell's Background and Font color handling.

In a TAdvStringGrid, in grid.OnGetCellColor event-handler, I've set each cell of the fixed column to a different color:

ABrush.Color := GetMyCustomColor;

Open in new window


Now, when I click on a cell of this fixed column, in the grid.OnClickCell event-handler, I want to get the color of the clicked cell.

How can I do this?

I have tried:

grid.GetCellProperties(ACol, ARow).BrushColor)

Open in new window


But it does not work. I always get the same color: RGB(255, 255, 255).
0
I have quite normal parameter like:

Procedure Something(var test:integer);

In the form i have a global variabel (well global to that form) defied as:

  public
    { Public declarations }
   var gtest :integer;


Now i want to transfer the pointer from test to gtest.

gtest :=test; wont work. How should it be done?
0

Delphi

59K

Solutions

17K

Contributors

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.