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

Hi

using Delphi 10.1 and outlook 365.
There are only some clients where I have the problem: I can not send EMail from my application. On my computer and most other clients-computers it works. But there are computers, where only outlook is startet but no send-window is opend. Retring a second time, outlook is startet also a second time...
  OutlookApplication1.Connect;
  try
    MailItem1 := OutlookApplication1.CreateItem(olMailItem)  as _MailItem;
    while toAdress <> '' do
    begin
      if Pos(';',toAdress) > 0 then
      begin
        MailItem1.Recipients.Add(Copy(toAdress,1,Pos(';',toAdress)-1));
        Delete(toAdress,1,Pos(';',toAdress));
      end
      else
      begin
        MailItem1.Recipients.Add(toAdress);
        toAdress := '';
      end;
    end;
    MailItem1.CC := ToCC;
    MailItem1.BCC := ToBCC;
    MailItem1.Subject := Subject;
    if EMailOutlookAbsender = '' then  //local definitions?
    begin
      if Pos('@',getOptionMandantS('EMail_Absender','')) > 0 then
        MailItem1.SendUsingAccount := OutlookApplication1.Session.Accounts.Item(getOptionMandantS('EMail_Absender',''));
    end
    else MailItem1.SendUsingAccount := OutlookApplication1.Session.Accounts.Item(EMailOutlookAbsender); //globale Einstellung
    Mailitem1.BodyFormat := olFormatHTML;
    //the default signature is added
    ObjectInspector := Mailitem1.getinspector;

    if ObjectInspector.EditorType = olEditorWord then
    begin
      WordEditor := 

Open in new window

0
Embarcadero documentation says TFileOpenDialog.ClientGUID "holds a GUID associated with a dialog's persisted state".

But where does it store this persisted state? Does it persist between session of the application or just throughout one session?
0
I am programming with Delphi XE 10.1 Berlin
Is it possible that the "hint" text defined on a TStringGrid when it becomes visible, has different texts if the mouse is over one cell or another ?
0
I save text files created in some kind of program developed by delphi 5.The default type of text encoding is ANSI. I don't want to use notepad to convert a  File From ANSI to UTF8.

So how can I convert a  File From ANSI to UTF8 by delphi 5? Thanks.
0
Hello guys,

I need help to create a function, I am trying it, but I confess that I am lost.

The function works with date, then imagine you have a formatted date like 20/12/2019  (dd/mm/yyyy)

I want to add 40 days on it or any days ahead (30, 70, 84, etc days), until here it is fine for me and I can do that, very easy.

Now, this part is my problem, I have a list of possible day that my date must be, for example 3,6 ( Tuesday and Friday), if my date
after added 40 days ahead gets on Saturday or Sunday or Monday, it must be placed on Tuesday.
If my date is on 4, 5 ( Wednesday or Thursday) it must be placed in Friday;

The rule of my string possibles days can be change, today I work with 3,5 but in the future, it must be in 2,7.

I thank a lot any help
Alex
0
It appears that this Version of Delphi has removed access to private Fields.
JvFormStorage produces an AccessViolation when trying to exctract Sections.

Code Snippet:

function TMemIniFileHelper.ValueExists(const Section, Ident: string): Boolean;
var
  I: Integer;
  Strings: TStrings;
  Sections: TStringList;
begin
  {$IFDEF RTL310_UP} // 10.1 Berlin removed the access to private fields
  Sections := TMemIniFileAccess(Self).FSections;
  {$ELSE}
  Sections := Self.FSections;
  {$ENDIF RTL310_UP}
  I := Sections.IndexOf(Section);
  if I >= 0 then
  begin
    Strings := TStringList(Sections.Objects[I]);
    I := Strings.IndexOfName(Ident);
    Result := I >= 0;
  end else
    Result := False;
end;
0
Is there an easy and elegant way to detect if a specific object has been created ?
In my case, objects to verify are forms.
Thanks
0
Hello;

I have a c++ program which launch a Delphi DLL where there are informations i need in C++.

So I need to return data from Delphi to C++.

I make some tries, and the last succefull try was to pass a c++ pointer to function and use the function in the delphi side;

Until Now, everything is OK;

the problem occurs when i try to send string from Delphi to C++; I receive non comprehensible string; ( chinese letters + arabic letters + mathmatical symbols ).

after several tries; I noticed that in Delphi, the problem occurs if there is a UnicodeString or String in the program even if it is not in the string sent to C++.

If I have only PWideChar in the program, that works; if there is String or UnicodeString, AnsiString ..., (even if it is not concatenated to PWideChar), the received string is unreadable.

I hope find a solution for this problem. I will put some code in commentaires.
0
I am using Delphi from within Rad Studio 10.2 to write a small program to see exactly how to talk to a device via USB. The device will appear as a Com port. I have a working shell for my program and started to write in the details for how to open, configure, write to, and close a port. I started with close because it is the smallest. I am getting the error message undeclared identifier 'CloseHandle'. Is there a UNIT I need to add to USES ?
0
Hi, I have been trying to Build a 64 bit Delphi project with a Bamboo Continuous Integration Build Server.

The weird thing is that I'm able to build the 64 bit project on the server machine itself using MSBuild in the Windows Command Line, but not through Bamboo.

But when making Bamboo run the same cmd script as on the server itself it always returns the error:
'error F1027: Unit not found: 'System' or binary equivalents (.dcu)'

Searching Google said that this was a problem with not including the right paths for the relevant Delphi components. But after including all of the paths it still doesn't compile a 64 bit Delphi project.

Here is the cmd batch script that Bamboo executes:
@SET BDS=C:\Program Files (x86)\Embarcadero\Studio\19.0
@SET BDSINCLUDE=C:\Program Files (x86)\Embarcadero\Studio\19.0\include
@SET BDSCOMMONDIR=C:\Users\Public\Documents\Embarcadero\Studio\19.0
@SET FrameworkDir=C:\Windows\Microsoft.NET\Framework\v3.5
@SET FrameworkVersion=v3.5
@SET FrameworkSDKDir=
@SET DXVCL=C:\Program Files (x86)\DevExpress VCL
@SET PATH=%FrameworkDir%;%FrameworkSDKDir%;C:\Program Files (x86)\Embarcadero\Studio\19.0\bin;C:\Program Files (x86)\Embarcadero\Studio\19.0\bin64;C:\Users\Public\Documents\Embarcadero\InterBase\redist\InterBaseXE3\IDE_spoof;$(BDSLIB)\win32\release;$(BDSLIB)\win64\release;$(BDSLIB)\win32\fura;$(BDSLIB)\win64\fura;C:\Program Files (x86)\Embarcadero\Studio\19.0\source\rtl\sys;C:\Program Files (x86)\DevExpress VCL\Library\RS25;C:\Program 

Open in new window

0
I have a service written in Delphi.  it has been tested and run on many machines.
it writes to a log file(on create/install/uninstall), then starts an executable periodically

however, setting it up on a new 2016 server VM (created through Azure if that helps)
isn't going to well.

the log file isn't being written to(ever), and the the service absolutely is refusing to start.

the application it is starting has been tested and is runs with no issue.

the Account being used is the local system.
we have also tried using the admin user, same result.
It fails with error 1053,  and no log is generated (I have startup message in the create statement), I don't know where to look

any idea would be appreciated
0
Hi,

I have al lot of coded strings that look like below.
  '     END                  ' + chr(13) +
  '   ELSE ' + ''MyVar'' + '                           ' + chr(13) +

Open in new window

What I would like to accomplisch is to remove all spaces, except one, before ' + chr(13) +. The number of spaces will differ per line of code.
Result should be:
  '     END ' + chr(13) +
  '   ELSE ' + ''MyVar'' + ' ' + chr(13) +

Open in new window


Is there an easy way to do this automatically inside the Delphi Editor (maybe some macro?), or is there another solution?
Thanks!
0
I have started a project which connects to a Facial Reader.
For the life of me, I can't seem to import the functions in this dll into Delphi.

This dll was written in C#.

The commadline:

%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\regasm C:\Users\Public\Desktop\Riss.Devices.dll /tlb:C:\Users\Public\Desktop\riss.Devices.tlb

succeeds, but there are no exported functions in the resulting tlb - File.

Question is whether there is a Dll, which was written / adapted to Delphi?

If anyone has experience with this, I would REALLY appreciate your Input.
0
Hi

I will make an own form like this and save it in myForms:
type
  TMyForm = class(TForm)
  private
    FmyInteger : integer;
  public
  published
    property myInteger: integer read FmyInteger write FmyInteger default 0;
  end;

Open in new window


When I make a new form I can not see the new property. How I have to do?
unit myUnit;
  
  interface
    uses myForms;


type
    TF_MyForm = class(tMyForm)
    private
    ……..

    end;


var
F_myForm : TF_MyForm;


implementation

end.

Open in new window



I can use this property myInteger in code but I can not see it in the designer. How to do? Thanks, Peter
0
I am unable to get any reply from the Getit Package manager in Embarcadero RAD Studio 10.2 or Embarcadero C++ Builder  XE 10.1 Berlin.
Does anyone know when this will be fixed by Embarcadero ?
0
Hi Experts!
I am having a lot of trouble finding a code that encrypts a string (max 100 characters) with php code and that it is possible to decrypt the same string in Delphi (Tokyo version 10.2).
I searched a lot online and also on EE. Such as here:

https://stackoverflow.com/questions/7052219/php-to-delphi-and-back-encryption-decryption-using-rijndael
https://www.experts-exchange.com/questions/26199791/Encrypt-in-Delphi-Decrypt-in-PHP-and-Vice-Versa.html
https://www.experts-exchange.com/questions/26402183/Rijndael-128-bit-Encryption-with-Delphi-and-PHP.html

But none of these works!

The solution to use the base64 encode/decode is not enough.
I would appreciate Rijndael 128 bit Encryption or better.

Many thanks in advice.
0
Is it possible to hide the main form in a Windows application written in Embarcadero C++ builder XE 10.1  ?
0
I have not been able to implement an event handler for a StringGrid OnMousedown event when the stringGrid is a multi-platform application with a target of Windows 32.
the compiler (C++ builder Embarcadero XE 10.1Berlin) gives a compile time error where the event handler is assigned in the constructor for the form Form3.

[bcc32 Error] Unit3.cpp(17): E2034 Cannot convert 'void (_fastcall * (_closure )(TObject *,TMouseButton,TShiftState,int,int))(TObject *,TMouseButton,TShiftState,int,int)' to 'TMouseEvent'
  Full parser context
    Unit3.cpp(15): parsing:  _fastcall TForm3::TForm3(TComponent *)

the code is as follows:

__fastcall TForm3::TForm3(TComponent* Owner)
	: TForm(Owner)
{
	StringGrid1->OnMouseDown = StringGrid1MouseDown; // <-----This giver a compile error
}
//---------------------------------------------------------------------------
void __fastcall TForm3::StringGrid1MouseDown(TObject *Sender, TMouseButton Button,
		  TShiftState Shift, int X, int Y)

{
	TStringGrid *g;
	int col, row;
	bool fixedCol, fixedRow;

// ... code to handle mouse-down event
}

Open in new window


Can this be corrected ?
0
Hello all,

I need to use an old component suite (IMSR) with an old Delphi 7 project. I just have docs and help for this components but I can't find some description on how to send inline graphics using attachments. The requirement is to add some little icon-like graphics and one or two company logos in the mail footer.

So if I had those graphic files available on disk, how can I send them as inline graphics within a HTML mail, rather than as attached files?

Currently, I can send simple HTML files by writing HTML-style text into the mail body. I just don't know how to add attached files and refer to them from HTML mail.

Any help on this is appreciated.

TIA
Michael
0
Hello Guys,

I don't know if it is possible, but could I change the popup menu cursor?

Thanks
Alex
0
Hello Guys,

I create this code:

   ie := CreateOleObject('InternetExplorer.Application');
   h  := ie.hwnd;
   ie.visible      := false;
   ie.fullscreen   := false;
   ie.TheaterMode  := false;
   ie.MenuBar      := False;
   ie.AddressBar   := False;
   ie.Resizable    := true;
   ie.StatusBar    := False;
   ie.ToolBar      := 0;
   ie.Width        := Panel2.Width;
   ie.Height       := Panel2.Height+27;
   ie.top          := -27;
   ie.left         := 0;

   sleep(3000);
   windows.setparent(ie.hwnd, panel2.handle);
   ie.visible := true;
   if _htmlDireta<>'' then
     ie.Navigate(_htmlDireta)
   else
     ie.Navigate('about:blank');

Open in new window


I want to work with 2 bottons, one for goback and another to goforward.
But before using it, I need to check if my IE has changed and has a history page
How could I check my IE change?

I found the command but I don't know how to insert it into my code:

https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa768361(v=vs.85)

something like in this example:

https://www.swissdelphicenter.ch/en/showcode.php?id=1158

Note: I can't use the TWebBrowse that comes with Delphi due to being out-of-date.

regards
0
Hello Guys,

I developed a simple project where I embebed an IE into a panel, it is ok so far.
I have two problems with my small project:

1) left and top of my IE created into a panel, I can't set it to left=0 and top = 0
2) I would like to have my IE created into my panel without any borderstyle. For this, I tried that command:
SetWindowLong(ie.Handle,GWL_STYLE,  GetWindowLong(ie.Handle,GWL_STYLE) and (not WS_CAPTION) or WS_THICKFRAME);

But I haven't had any success yet.
Web2.rar
the project has only one unit.pas and you can open it in any Delphi version. I use Delphi 2007.

After opening the project, click on the button Browse, it will create a IE into panel1, there is another button named "Mostra Pn" where a panel3 will hide or not and the IE in panel1 should resize automatically.

my code
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
  ie := CreateOleObject('InternetExplorer.Application');
  windows.setparent(ie.hwnd, panel1.handle);
  s:='http://www.microsoft.com';
  s:='https://mercado.khan.com.br/qualidade/historico.aspx';
  ie.Navigate(s);

  ie.fullscreen:=false;
  ie.MenuBar := False;
  ie.AddressBar := False;
  ie.Resizable := false;
  ie.StatusBar := True;
  ie.ToolBar := 0;

  ie.top    := 0;
  ie.left   := 0;
  ie.Width  := panel1.Width;
  ie.Height := panel1.Height+27;


  ie.visible := True;
// SetWindowLong(ie.Handle,GWL_STYLE,  GetWindowLong(ie.Handle,GWL_STYLE) and (not WS_CAPTION) or WS_THICKFRAME);  // I 

Open in new window

0
procedure TForm1.Button2Click(Sender: TObject);
var
yazi : string;
toplam:integer;
begin
yazi:=Edit1.Text;
dmcd.OraQuery1.Close;
dmcd.OraQuery1.SQL.Clear;
dmcd.OraQuery1.SQL.Text:='select * from KIMLIK'; //I get the data.
dmcd.OraQuery1.Open;
toplam:=dmcd.OraQuery1.RecordCount; //the count of the data is 25 here.
Label1.Caption:=toplam.ToString;
end;

procedure TForm1.Button3Click(Sender: TObject);
var
toplam:integer;
begin
toplam:=dmcd.OraQuery1.RecordCount;//When I put down the scroll bar of dbgirid, the number of data is 25587.
Label1.Caption:=toplam.ToString;
end;

Open in new window

0
rocedure TForm1.Button2Click(Sender: TObject);
var
yazi : string;
begin
yazi:=Edit1.Text;
dmcd.OraQuery1.Close;
dmcd.OraQuery1.SQL.Clear;
//dmcd.OraQuery1.SQL.Add('SELECT * FROM KIMLIK WHERE dosya_no= '+Edit1.Text ) ;
//dmcd.OraQuery1.SQL.add('SELECT * FROM KIMLIK WHERE ADI Like "'+Edit1.Text+'%"');

//dmcd.Oraquery1.SQL.Text:='SELECT * FROM KIMLIK WHERE lower(adi)='+ yazi;
//dmcd.Oraquery1.SQL.Text:='SELECT * FROM KIMLIK WHERE dosya_no='+ yazi; this is work

dmcd.Oraquery1.SQL.Text:='select * from KIMLIK where (name)=' +yazi;//this is not work
dmcd.OraQuery1.Open;
dmcd.OraQuery1.Active;
end;
Top

Open in new window

0
4.jpghi expert

the update service references operation in visual studio
how to do delphi (rad studio )?

how to update service references operation  in delphi?
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.