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,

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
Expert Spotlight: Joe Anderson (DatabaseMX)
LVL 13
Expert Spotlight: Joe Anderson (DatabaseMX)

We’ve posted a new Expert Spotlight!  Joe Anderson (DatabaseMX) has been on Experts Exchange since 2006. Learn more about this database architect, guitar aficionado, and Microsoft MVP.

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
Bootstrap 4: Exploring New Features
LVL 13
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

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
Hey

I am new here and in my spare time (as a hobby) I try to make utilities for use at my school (I work at a school administration). For this I use Delphi XE7. But now I have a problem that I can't find a solution for. Hopefully you can help me with that.

I have recently been forced to communicate via a web service. For this I have to use the "sendmsg" function. In the imported supplied WSDL file, the function is defined as follows:

function  sendMsg(const accesscode: string; const userIdentifier: string; const title: string; const body: string; const senderIdentifier: string; const attachments: Variant; const coaccount: Integer; const copyToLVS: Boolean): Variant; stdcall;


The server with which I have to communicate describes the function as follows:

sendMsg

With this method you can send a message to the main account or a co-account of a specific user. Specifying the sender and / or attachment is optional.
•      string $accesscode: Web services password
•      string $userIdentifier: Unique field user of the recipient
•      string $title: Title of the message
•      string $body: Text of the message
•      string $senderIdentifier: Unique field user of the sender (optional)
•      mixed $attachments: Attachments (1 or more) in base64 encoding (optional)
•      integer $coaccount: Type of account ('0' = main account, '1' = co-account 1 or '2' = co-account 2…). $ coaccount is optional: if this is not specified then the message will be sent to the
0
I need to import text from PDF Files where columns need to be added to a Table.
Columns must be preserved in the Text File.

I have tried some, but they are either not doing the job properly or are too expensive ($ 2000.00)
0
type

     TUser=class(Tremotable) //1
     private
     FLastname:AnsiString;
     FFirstName:AnsiString;
     FID:Int32;
     public
     constructor create (id : integer ;firstname:string;lastname:string );
     published
         property id:int32 read fid write fid;
          property Lastname:AnsiString read FLastname write FLastname;
            property FirstName:AnsiString read FFirstName write FFirstName;
     end;

Open in new window

0
I am writing a C++ builder VCL application using embarcadero XE10.1.
I have a TMemo control on the main form and wish to determine the line of text in the Memo window that is clicked on with a mouse.
The TMemo control has several lines of text.
I suspect that the OnMouseDown event handler could be used but I need to know how to determine the line of text corresponding to the Y value in the event handler ?

Thanks,

Roger
0
The Delphi IDE creates ftFloats and I would prefer ftBcd and Currency data types.
0
Learn SQL Server Core 2016
LVL 13
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.

Hello,
is it possible to "fake" a button click event? I mean, when i click on button1 then in button1 should be a button2 click.
I know it is not an good idea but how nevertheless can i do that?

Thank you.

procedure TForm1.Button1Click(Sender: TObject);
begin
    // Here should be a button2 click event
end;
0
I have recently updated Embarcadero RAD Studio to version XE 10.3.
I am less than satisfied with the new Code Completion feature as  compared to prior versions such as 10.2.3.
Is there any way that he code completion display in version 10.3 can be configured to be the original format that was used in previous versions ?
Apart from the abundance of superfluous information, the search on partial terms doesn't work.

I attach examples of each version of code completion for dereferencing a TButton control pointer variable as an illustration.
RADStudio10.3Codecompletion.JPG
RADStudio10.2Codecompletion.JPG
0
Hi
I am developing components with Delphi 10.3. Now I have the following problem: when I uninstall the package I get the error "Exception EPrivilege in modul rtl260.bpl at address …". I have to end the process and restart Delphi. After this the component is no longer installed, so I can rebuild and install it. Uninstalling again, same problem. Has anybody an idea how can I find the wrong code in the component?
0
Hi.

We have a legacy application, made with delphi, and we´re having a strange issue on Windows 10.

When we input login credentials in the application, it uses "Registry.OpenKeyReadOnly" and verify for a key in HKEY_LOCAL_MACHINE\SOFTWARE\<appname>.
Then it uses Registry.ValueExists, if the key doesn´t exist, it gives an error "please install application". If exists, it proceeds with login.

We never had an issue with Windows 7, both x86 and x64.

Recently we upgraded our stations to Windows 10. And the application was working for weeks. Now, some stations (some x86 and others x64) are returning the "please install application" error, even if the key exists. That happened in 4 stations yesterday, and today another 3 started having the same problem.

And that just happens with the current local user. If we run as administrator, it works. If another non admin user logs on that machine, it works too. If the same user logs in another machine, it also works (even if the current user in that machine is having the login issue).

I thought it might be a permission problem, but with Powershell, if I run "Get-ItemProperty Registry::HKEY_LOCAL_MACHINE\SOFTWARE\<appname>" I get all the keys informations. I can also see the keys with regedit.

Then I thought about some recent windows update, but my user (non admin) can login with the application in another station with all updates installed, and doesn´t work in mine.

Any ideas? Really lost here.
0
Delphi XML Data Bindings are proving tough to code for me. Learning how-to the correct way is my goal here. With the attached XML file, I am simply stuck as to the next thing I do to get any data into a memo control.

I am using Delphi 10.3 Community version, and am creating a new firemonkey app.

If someone could show how to get the most basic data out from the XML file attached onto a memo, it would be a great leap forward for me.

For clarity, I'm pretty much new to Delphi and I have tried many online resources (videos, tutorials, blogs) to get to grips with this, but even the included Delphi help file has minimal information as guidance.
MAIN2.xml
MAIN2.xdb
0
I have developped a service using Delphi XE10.1 Berlin.
One timer interval is T1, the other is T2 (20 and 120 seconds respectively).
The first when activated, processes some input and send emails using email component accordingly.
The second just write a line in a log file.
Sometime the input to process is very large, and it can last for 3 minutes.
What is strange, is that the other timer, that should be activated during that interval is not.
Is this related to the heavy work of the other ?
Shall I place a kind of ProcessMessages (not available in TService component) or something else to have the second timer working during the working time of the first one ?
Thanks
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.