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

Hello
Can you help me please!!! i have this message when i run my project
"Débordement de pile".
Thanks
0
On this form, there are (3) TDBGrids. OnCalcCellColors  or OnDrawDataCell, need to compare a value in grid1 with a corresponding value in grid3. The row color for all (3) grids will be determined by the comparison. >= Red, < Green etc...

The coloring is easy. However without ARow & ACol cell references, not sure how to index the values. Works great on a single grid.
Doing the comparison in this manner with negate the need to  Enumerate the data set.
0
I have an application that checks for files create by a Point of Sale application and then imports these files. It also compares the files and write to a settings file what the last time was it imported a file.

I have a problem where my application runs fine for a random amount of time (normally between 2-5days), then all of a sudden my application loses the ability to write to any file in Windows, even files created by my application and files that it was able to access just moments ago.

If you restart the application, everything works fine again for a random amount of time.

This happens on Windows 7/8/8.1/10/ server 2012

Code to write to the File:
function TFrmMain.CompareFileDate(sFileName : string): Boolean;
var
  dOldDate  : TDateTime;
  dNewDate  : TDateTime;
  ini       : TIniFile;
  iFileDate : Integer;
begin
  try
    //Get Old File Date
    ini := TIniFile.Create(IniFileName);
    try
      dOldDate := ini.ReadDateTime('Import','LastImportedFile',0);

      //Get File Date and Time
      iFileDate := FileAge(sFileName);
      dNewDate  := FileDateToDateTime(iFileDate);

      if dNewDate > dOldDate then begin
        Result := True;
        ini.WriteDateTime('Import','LastImportedFile',dNewDate);
      end else
        Result := False;
    finally
      FreeAndNil(ini);
    end;

  except
    on e : Exception do begin
      Result := True;
    end;
  end;
end;

Open in new window

0
Hello,

Im trying to add persistent fields (FieldDefs) and then add those fields to Fields. From the start i have only 2 fields:

Id : ftInteger
Name : ftString

When i create a new field "Test":ftString and try to add the new persistent field to "Fields" i get error "Missing dataprovider or datapack". Its a standalone use of clientdataset, no provider. When i then go to the fields editor and try to "add fields", the field dissiperar from field-defs. If i the right click on the cds and select "clear data", and then "create dataset" i get error "invalide fieldtype". If i skip to add persistent fields and just add it as a field, i get error "Catastrophic failure"....


Only way i found seems to:

(1) Manually delete all not persistent fields.
(2) Clear dataset
(3) Add the new persistent field
(4) Add all fields.

Not so very brilliant if i have properties on my fields. Clientdataset looks like it been around forever so i'm surprised it bugs like this, or am i missing someting?

unit MissingField;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, Vcl.ExtCtrls, Vcl.DBCtrls,
  Datasnap.DBClient, Vcl.Grids, Vcl.DBGrids;

type
  TForm6 = class(TForm)
    DBGrid1: TDBGrid;
    ClientDataSet1: TClientDataSet;
    DataSource1: TDataSource;
    DBNavigator1: TDBNavigator;
    ClientDataSet1Id: TIntegerField;
    ClientDataSet1Name: TStringField;
  

Open in new window

0
I apologize for having to start another thread regarding this. But it's been over a week since the problem occurred. I have messaged a few members on here who are for hire but to no avail.

So the last time, my computer had a power outage while I was inserting data into a table on paradox. When I turn back on the computer and try to access the table it says the index was out of date. I believe it was because the something was written on the primary index and not the secondary which resulted in a header inconsistency. As suggested I downloaded some auto table rebuild/repair software; including the one that came with paradox (TUTILITY). After I rebuilt the index using TUILITY the problem was fixed, but another problem in another index occurred. This led me to doing a series of trial and error with the different software, and the outcome varied.

It seemed the more I messed with it,, little bits and pieces were being fixed, while I think perhaps I was making the problem more complex. And finally where I'm at now, most of the data is fine and I can work with, except one key component. My QTY-LEFT.DB shows some of the items with quantity left and the product order number, while a bunch of random ones are missing. I'm not sure if one of the software I used overwrote something. I deleted all my old files and index because I thought everything was fixed. It wasn't until I realized that this little bit was missing.

I've been working on it for eight hours straight today, but …
0
I have searched online and have been unable to find a recent example as to how the eBay API can be called from a recent version of Delphi XE using Indy.

If anyone can post here such a piece of code, I am sure it would save many people a lot of time trying to figure it out.

Many thanks!
0
Hi everybody,

I working to implement CD burning capabilty with IMAPI on D2007/XE/Berlin.
I don't want components or DLL.

I have try to write in Delphi this code:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa364817(v=vs.85).aspx
with also the "Monitoring Progress With Events"
Has anyone already done it and can help me?
0
[Using Delphi] Hello Guys, i have a client/server unprotected application that cant be replaced and i dont have it sourcecode.
So i need to create a bridge between those applications like:
Client > ClientBridge > ServerBridge > Server
Why?
On ClientBridge i need encrypt the data sent from Client and on ClientServer i need decrypt those data and repass to server, server should answer so the process must be bidirectional.
I Could repass the data easily using Indy IdMappedTCPPort, however, i was wondering how to encrypt the data.
If i put any code on IdMappedTCPPort OnExecute() event the data is not repassed.
Keeping in mind that the "encrypt" could be of any type, the intention is to not allow the client comunicate directly with server without the bridge, and of course, protect the data.
0
Hello Guys,

Using indy when I try to post my code json to the serve, I got the follwing message:

415 UNSUPPORTED MEDIA TYPE

Where is the problem? The way that Json was created? Any declaration that I forgot?

I appreciate a lot any help on this


procedure TForm1.Button3Click(Sender: TObject);
var
  PostData: TStringList;
  JsonStreamRetorno, JsonStreamEnvio: TStringStream;
  rta, json: string;
begin

  JsonStreamRetorno := TStringStream.Create('');
  JsonStreamEnvio   := TStringStream.Create('{"nome": "AlexandreTeste",' +
                                            '"amb_uuid": "c75831f0-4561-4de8-b722-dd82f06f7a01",' +
                                            '"email_admin": "Alexandregarcia@khan.com.br"}');

  IdHTTP1.Request.Clear;
  IdHTTP1.Request.CustomHeaders.Add('Authorization:ace49f940a034ea4a35c8157d4620c3a');
  idHttp1.Response.ContentType := 'application/json';
  idHttp1.Response.CharSet := 'UTF-8';

  try
     IdHTTP1.Post( 'https://khanhomolog.skyinone.net/v2/api/clients/' , JsonStreamEnvio, JsonStreamRetorno);
   finally
    PostData.Free;
  end;

  Memo1.Lines.add( JsonStreamRetorno.DataString )

end;

Open in new window


Alex
0
after open file dialog how could i save this file to DB

openDialog := TOpenDialog.Create(self);
  openDialog.InitialDir := 'D:\';
 openDialog.Options := [ofFileMustExist];
//
//  // Allow only .dpr and .pas files to be selected
 openDialog.Filter :=
   'All files (*.*)|*.*';
//  // Display the open file dialog
 if openDialog.Execute  then
 title:=openDialog.FileName;
  TFileStream.Create (title, fmOpenRead);
  dbAttach_Title.Value:=title;
  //'File : '+openDialog.FileName;
//  else ShowMessage('Open file was cancelled');
0
Hello guys

I developed a procedure where I could get the result from my idhttp,

but it doesn't even work with this simple line:

https://khanhomolog.skyinone.net/v2/api/users/

that should return me:

{"detail":"As credenciais de autenticação não foram fornecidas."}

what is wrong in my code?

procedureTForm1.RetornoHttpGet2(): String;

var
  S: TStringList;
  M: TStream;
begin
 S := TStringList.Create;
 M := TMemoryStream.Create;
 try
   S.Values['token']     := 'ace49f940a034ea4a35c8157d462744a';
   S.Values['nome']      := 'fabio';
   S.Values['sobrenome'] := 'marq';
   S.Values['email']     := 'meuemail.gg@ksac.com.br';
   S.Values['ativo']     := 'True';
   S.Values['username']  := 'denis';
   S.Values['password']  := '190679';
   S.Values['cli_uuid']  := 'xxxxxxxxxxxxxx';


    IdHTTP1.Request.Accept         := 'text/html, */*';
    IdHTTP1.Request.UserAgent      := 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0';
    IdHTTP1.Request.ContentType    := 'application/x-www-form-urlencoded';
    IdHTTP1.Request.AcceptCharSet  := 'ISO-8859-1,utf-8;q=0.7,*;q=0.7';
    IdHTTP1.Request.AcceptLanguage := 'pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4';
    IdHTTP1.HandleRedirects        := True;

   IdHTTP1.Post('https://khanhomolog.skyinone.net/v2/api/users/', S, M);
   Memo1.Lines.Add(Format('Response Code: %d', [IdHTTP1.ResponseCode]));
   Memo1.Lines.Add(Format('Response Text: %s', [IdHTTP1.ResponseText]));

   M.Position := 0;
   

Open in new window

0
I don't succeed  to connect mySql database from within my WebSite to  FDConnection component. Though I set all necessary fields given by the "info" button (in the  "Control Panel")  of my hosting server.  
it seems the hosting name given "mysql1051.servage.net" is not accepted by the component!
Please Help
0
I have this password-protected .mdb database. There is a table I need to copy into a different non-protected mdb database. I need to perform this task using Borland Delphi 7 ADO components. help?
0
Hey guys so I have a big problem. About 20 years ago my partner helped program a software for our business but he is no longer here with us. I have all my company information stored in this program. Yesterday suddenly my computer crashed while paradox was running. But I managed to boot it back up.

When I reopen PARADOX And try to access the directory this shows up

Cannot open LINEITEM.DB.
Index is out of date.
Table C:\GM2\LINEITEM.DB

Now I am completely computer illiterate and have tried to do my own research but it's like you guys are speaking in a different language. So it would really be appreciated if anyone can explain to me how I can fix this in more simple terms. I'm thinking reindex?
0
I have use other db components in delphi, but I am having a particular issue using firedac.
Using Delphi10 Seattle, Sql Server 2012.
I have a firedac table pointing to a dataset.
that dataset has 3 fields.


reg_id (integer)
id_css(varchar 8)
reg_value (varchar(250))

i have this table joined to another table using masterdetail, on the reg_ID
a particular record exists in the data set, and is shown in this query:

select * from dbregval where id_css = 'PSI99'
order by reg_id
(see pic1)
pic1.JPG
regID = 128000.
id_css = psi99
value string = '1'

in the program, I set the filter options to FOCaseInsensitve, foNoPartial
I have set this both at the component level and in code, before the table is opened.

when reg_id is 128006, a records is found (because id_CSS in db is PSI99)
(see file 128006.jpg)
128006.JPG
however, when reg_id is 128000, no record is returned in firedac
(dmCommon.tblUserReg.isEmpty is returning true)
(see file 128000.jpg)
128000.JPG
This is the sql as reported by firedac monitor, when I refresh the table:

SELECT A.*
FROM dbo.dbRegVal A
WHERE (A.reg_id = :reg_id) AND
(((A.reg_id = :FD__WN_reg_id) AND (A.id_css < :FD__WN_id_css)) OR ((A.reg_id < :FD__WN_reg_id))) AND
(id_css = 'PSI99')
ORDER BY A.reg_id DESC, A.id_css DESC

so, the question is : how do I use case insensitive filters, using firedac?
and why is this not working?  I'm new to firedac?
any idea what it is that I am …
0
Hi
i'm developping a project with delphi 7 and  I need to copy some fields from one table in paradox 9 to another table in paradox 9 .
Somebody help me please .
0
Hello, I'm a Windows software developer (Delphi language) and I'm trying to install one of my programs on a client's newly rented machine running Windows Server 2016 64-bit (this OS is uncharted territory for me).  Even though my program is developed in 32-bit, it runs on pretty much any other Windows OS and also 64-bit systems. Tried and tested. When I try to install it on this particular system though, I get a big blue window with the message:

"This app can't run on your PC"

(see attached screenshot), see additional screenshot for specs of machine).

Could it be some heavy duty anti-virus scanner running on that machine rejecting my software? Any thoughts please?

Thanks
    Shawn
ee-1.jpg
ee-2.jpg
0
Hi

I looking for a TEdit with gradient color.  How to change a TCustomEdit for this?

thanks
0
I am a total novice regarding Delphi. I am trying to build a package for eventual use in a C++ builder project (in which language I am not a novice).
I am using code that I have found for using Smart cards.
the following code fragment generates an error and I need assistance to understand why and correct it.
I am using Embarcadero RAD Studio 10.2 enterprise edition

var
  r : string;
  a : integer;
begin
  a := 1;
  while a <= Length(Input) do
    begin
    case Input[a] of
      #010       : if WantFormats then r := r + #10 else r := r + ' ';
      #013       : if WantFormats then r := r + #13 else r := r + ' ';
      #027       : if a < Length(Input) then
                     begin
                     Inc(a);
                     r := r + Extended[Ord(Input[a])+1];
                     end else r := r + ' ';
      #128..#255 : ; {<<<<<<<<< This line gerates the error }
      else r := r + Ascii[Ord(Input[a])+1];
      end;
    Inc(a);
    end;
Result := r;
end;


gives the following error message
[dcc32 Error] GsmHelper.pas(551): E2011 Low bound exceeds high bound

Open in new window

0
Hi,

I'm trying to create subfolder in the TaskScheduler (using Delphi) and create schedules for my application inside the subfolder.
For TaskScheduler-access I use this EE-example.

To create a subfolder I found method TaskFolder.CreateFolder('\MyFolder', ?sddl?);.
Here sddl (=security descriptor associated with the folder) must be set, but I have no idea how to set it correctly.

So as a workaround I tried to create the folder "MyFolder" directly into folder "C:\Windows\System32\tasks\".
The folder is actually created by my application, but the folder is not visible inside Windows TaskScheduler.

procedure TForm1.Button1Click(Sender: TObject);
var ts : TTaskScheduler;
    tf: ITaskFolder;
begin
  CoInitialize(nil);                    // uses ActiveX
  ts := TTaskScheduler.Create(Self);
  try
    ts.AutoConnect := True;
    ts.Connect1(GetNetComputerName);
    if ts.Connected then
    begin

      // ts.GetFolder('\MyFolder', ?sddl? );   << THIS DOESN'T WORK
      // As a workaround I create the folder myself.
      // System32 is changed into SysNative, as otherwise the folder would be created in SysWOW64.
      ForceDirectories('C:\Windows\SysNative\tasks\MyFolder\');

      if DirectoryExists('C:\Windows\SysNative\tasks\MyFolder\') then
        tf := ts.GetFolder('\MyFolder')   // << THIS GIVES AN UNKNOWN ERROR
      else
        tf := ts.GetFolder('\');

Open in new window

How can I create a subfolder for taskscheduler in order to add my application's schedules inside that subfolder?
0
Hello,

I have an Android app written in Delphi Seattle.

I need to show a form modally in a function then get back the value of an Edit object.

However, this doesn't work:

Function GetMyValue: String;
Begin
  Form1:=TForm1.Create(Nil);
.....

     ShowModal(
         procedure(ModalResult: TModalResult)
         begin

           if ModalResult = mrOK then
             Begin
              Result  := MyEdit.Text;
             End;
             
         end);

I get a compiler message: [dcc32 Error]  E2555 Cannot capture symbol 'Result'
I know that in anonymous method I cannot refer to the main functions result, but I need to get back the text when the user closes the form.

How can I do that?
Thank you very much!
0
Hello guys I need help for transcript a routine in PHP for Delphi.

In PHP I have this routine

$i 			= 0;
$geral 	= 0;
while($resposta = mysql_fetch_array($sql)){

		$Qtd[]			        =	$resposta['QTD_ATUAL'];
		$ID_PRODUTO[]	=	$resposta['Id'];
		$CODIGO[]		        =	$resposta['CODIGO'];
		$LOTE[]			        =	$resposta['LOTE'];
		$VALIDADE[]		=	$resposta['VALIDADE'];
		
		$geral		                =	array_sum($Qtd);

$i++;
}

Open in new window


How do that  in Delphi?
0
I have created a mail program that use web browser as the body.

I must add a unsubscribe for the email body.

The code3 worked fine when I was using Delphi XE 8 . Now I am using Delphi XE 10.2.

My Code..
I have called TwebBrowser "htmlEditor"

Procedure TFrame15.Button1Click(Sender: TObject);
Var
  htmlDoc: IHTMLDocument2;
  HtmlSelObj: IHTMLSelectionObject;
  HtmlTxtRng: IHTMLTxtRange;
  S: WideString;
begin
  htmlDoc := htmlEditor.Document as IHTMLDocument2;
  htmlDoc.execCommand('InsertImage', false, '');
  HtmlSelObj := htmlDoc.selection;
  c:=('<a href=''mailto:'' + b + '?subject Unsubscribe>Unsubscribe</a>'''');
   if HtmlSelObj.type_ = 'Control' then
    HtmlSelObj.Clear;
    HtmlTxtRng := HtmlSelObj.createRange as IHTMLTxtRange;
    HtmlTxtRng.pasteHTML(S);
   htmlEditor.SetFocus();  
end;

Open in new window

0
How I Close and restart the current application I am using Delphi 10.2 Tokyo
0
I have a website that runs xenforo forum software. I basically have a donations user group and those users have the ability to download some software. I want to add a login form to my application that checks if that user is in that group and if he / she is then it will open the main form. I want to know how I can make such a login form?
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.