Jump to content

Search the Community

Showing results for tags 'delphi'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Found 113 results

  1. Greetings Dear Delphians, Say we have 20 Forms in an App. We use these 6 lines to create 20 Forms at different places. Form1 := TForm1.Create; try Form1.ShowModal; finally Form1.Free; end; When refactoring we can see this is a lot of code duplication and we should encapsulate form creation in a procedure like this. procedure ShowForm ( ThisForm: TCustomForm ) ; begin ThisForm := TCustomForm(ThisFormClass.Create);//?? How to Get Form Class try ThisForm.ShowModal; finally ThisForm.Free; end; end; I only have problem in first line. how to get ThisForm parent class to call it. Is it even possible? If yes then how? What about FMX? Any help or pointer is appreciated. Thanks and stay blessed
  2. We are hiring remote Delphi developers, Join our team. Details: https://www.mekashron.com/blog/en/post/delphi-developer-from-home
  3. How to delete all the files just in case you need to for some unknown reason. Manual uninstall of RAD Studio/Delphi/C++Builder 11.0 Alexandria Launch the License Manager from the bin folder (by default “C:\Program Files (x86)\Embarcadero\Studio\22.0\bin\LicenseManager.exe”) and delete any trial or beta (Test Field) license that you can find. Check it under “License Details” in the center column. Under your Control Panel’s Program and Features Add/Remove Program uninstall the following entries: RAD Studio 11 version 22.0 Please follow these instructions to remove any leftover files: 1. If Windows 64-bit, remove the C:\Program Files (x86)\Embarcadero\Studio\22.0 directory (or the custom folder you had used). 2. Remove the C:\Users\Public\Documents\Embarcadero\Studio\22.0 directory 3. Remove the C:\ProgramData\Embarcadero\Studio\22.0 directory. 4. Remove the %APPDATA%\Embarcadero\BDS\22.0 directory. 5. Remove the HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\22.0 registry key 6. If Windows 64-bit, remove the HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Embarcadero\BDS\22.0 7. If Windows 64-bit, remove the following files from C:\Windows\SysWOW64: BDEAdmin.* CC32*.DLL Midas.* Xerces*.DLL If you had problems in the second step (uninstalling from Windows Control Panel), try this Microsoft tool to solve un-installation problems: https://support.microsoft.com/en-us/topic/fix-problems-that-block-programs-from-being-installed-or-removed-cca7d1b6-65a9-3d98-426b-e9f927e1eb4d
  4. In my Delphi application I select a portion of a wave form for music in a Windows .wav file. I would like to then analyze that selection to produce a frequency spectrum like that in the image below. My objective is to identify the predominant musical pitches in the selection. How can I obtain the amplitude vs. frequency data points for plotting?
  5. Hello, Is there on easy way to install Quickreport 10.3 RIO in Delphi 10.4? Thanks Hans
  6. Hi, Using the VirtualTreeView, an error is raised but why ?. I have recreated a minimal sample to reproduce it. Either my coding does an error (more likely), either the component do it. The problem comes when a node is deleted (only when the deleted node has one sibbling with subnodes) from the OnGetImageIndex event. The event is called with an index greater than avalaible nodes. If someone has an idea ? Delphi 11 + VirtualTree for VCL 2021.09. Thanks a lot, Eddy TestVclVT.zip
  7. Devart rolled out the new Delphi Data Access Components for just released RAD Studio 11 Alexandria with support for Firebird 4 and Apple M1 processors. Devart, a recognized vendor of world-class data connectivity solutions for various data connection technologies and frameworks, presented new versions of Delphi Data Access Components to keep assisting software engineers in developing fast native applications. The key feature of the recently updated products is support for the newly released RAD Studio 11 Alexandria. The release also includes such important enhancements: All Devart Delphi Data Access Components now support Apple M1 processors. Devart became the first vendor of Delphi components with Firebird 4 support. UniDAC now includes new data providers for HubSpot and BigQuery that allow users to connect to these data sources from Delphi or C ++ Builder applications. UniDAC supports the latest version of NexusDB 4.50.27. LiteDAC and UniDAC support a new option - IntegerAsLargeInt, which maps SQLite INTEGER columns to fields of type ftLargeInt. In addition, a new demo project for FastReport FMX is available in all DAC products. To learn more about the recent release, visit: https://blog.devart.com/delphi-data-access-components-for-rad-studio-alexandria.html Delphi Data Access Components are the libraries of components for Delphi developers that provide direct access to multiple databases, and allow developing multi-platform applications in Embarcadero RAD Studio, Delphi, C++Builder, Lazarus, and Free Pascal on Windows, Linux, macOS, iOS, and Android, for both 32-bit and 64-bit platforms. About Devart Devart is one of the leading developers of database tools and administration software, ALM solutions, data providers for various database servers, data integration, and backup solutions. The company also implements Web and Mobile development projects. For additional information about Devart, visit https://www.devart.com/.
  8. Bob Baudewyns

    How to design QR Scan focus screen with FMX

    Hi, I'm developing an application that needs to scan QR Code. For the GUI design, I'd like to provide the usual scan focus screen with a transparent square inside a rectangle (the screen) like the attached mock-up. I already tried different approaches but not very successful. Any idea how could I design this with FMX ? Thanks
  9. Hey guys, so for this program I'm writing I want to check a string grid for empty rows/rows with just spaces in them and then subsequently deleting them to clean the grids up a bit. I made a procedure that reads the fields from a specific table in a DB and into a corresponding string grid. While 13 of the 14 grids I have, read the records like they're supposed to from the DB, one single table doesn't read correctly, it reads the same amount of records again as empty rows when displayed on the grid. For example, let's say I have 3 records in the table in the DB and I read it into the grid, the records display properly but then they add 3 more rows with just spaces in them. My code for this so far: procedure TfrmPuntehou.IncreaseRowCount(grid: TStringGrid); begin //increases rows in grid grid.RowCount:= grid.RowCount+1; end; procedure TfrmPuntehou.WriteToList(tbl: TADOTable;grid:TStringGrid); var Row: Integer; i: Integer; begin tbl.Active:= True; Row := 1; // Populate cells Tbl.First; while not (Tbl.Eof) do begin grid.Cells[0,Row]:= IntToStr(Row); grid.Cells[1,Row]:= tbl.fields[0].AsString; grid.Cells[2,Row]:= tbl.fields[1].AsString; grid.Cells[3,Row]:= tbl.fields[2].AsString; Inc(Row); IncreaseRowCount(grid); Tbl.Next; end; tbl.Active:=false; //what I'm planning to do to alleviate this but I'm not sure to use in the conditions of the if // because if I say grid.Rows[i] = ''/grid.Rows[i] = ' ' then I get an error // for i := 1 to grid.RowCount - 1 do // begin // if () OR () then // begin // grid.Rows[i].Delete; // end; // end; end; Illustration of what I'm talking about: What is supposed to happen: What's happening (the records are inserted correctly, but there are unnecessary rows here for only 3 records. When exported to a CSV the empty rows are filled with spaces"): Thanks in advance for any help on this! Kind Regards PrimeMinister
  10. shineworld

    TTouchKeyboard layout

    Hi all. I'm on a PC with the Italian language and an Italian true keyboard. In the VCL software, I would like to use the TTouchKeyboard. Is a technical software where I need to force TTouchKeyoard to display US keyboard layout, because chars as [ ] | # etc are mandatory instead of accented èéòàù of specific Italian layout. I've imported the Vcl.Touch.Keyboard.pas in project to add minor graphics changes, which works fine, but I'm not able to understand how to force English layout. I've tried to change CreateKeyboard method to say "use alwyas 'en' but doesn't works. function TCustomTouchKeyboard.CreateKeyboard(const Language: string): Boolean; var Index, RowIndex, ColIndex: Integer; Button: TCustomKeyboardButton; LeftPosition, TopPosition: Integer; KeyboardState: TKeyboardState; KeyboardLayout: TVirtualKeyLayout; Row: TVirtualKeys; FoundCaps: Boolean; _Language: string; begin Result := False; FoundCaps := False; for Index := 0 to FButtons.Count - 1 do FButtons[Index].Free; FButtons.Clear; FDeadKey := VKey(-1, -1); TopPosition := 0; _Language := 'en'; if _Language <> '' then FLanguage := _Language; The result is always: There is a way to force it ?
  11. I am very new in Delphi vcl development. My question might be very armature type but I need your help. Is there any way to install Delphi 10.4 package into Delphi 10.3?
  12. AndrewHoward

    Delphi books

    Hi, Which delphi books do you recommend ? Thanks
  13. Good night, I tried some ways here, but I was not successful, I am working in remote access, and I wanted that while I work on my client's machine, a form appears with loading and tals and for me it is transparent to be able to make the settings . Could someone give me a light on the part of appearing for him, and not for me? I am grateful.
  14. Hello Winapi lovers, I would like to have all notify icons (system tray?) in a seperate window. (everthing between taskbar entries and time display) Is that possible at all? Reason: I would run that program to have a OnTop window open that does not close on its own and inform me what icons are avail (usb device, network symbol, programms with their bubble[number], and such....) By default I do minimize TaskBar and having such would make my workflow alot easier! For now I even dont have a starting point. Searching Msdn did not result me any positive clue. I would also accept any pre-made application that do such to not reinvent wheels. Thank you for reading!
  15. Good day, I would like to have ability in my project to show certificate details of signed executables. (From other executables) Is that possible with Delphi? Would love to get hints 'how-to'! //edit For now I have ability to get raw data thats appended to executables (overlay data) by simply check PE header for filesize and compare with real physical filesize.
  16. bazzer747

    DecodeDate Issue

    Hi, I have a project where I need to get the value of a year in a field so I use DecodeDate( dtDate, Year, Month, Day); where dtDate is a TDateTime variable, Year, Month, Day are Word variables. When I run the code I get an error - 'Constant or type identifier expected'. I've downloaded the example Embarcadero have for using DecodeDate: procedure TfAccounts.Button1Click(Sender: TObject); var Present: TDateTime; Year, Month, Day: Word; begin Present:= Now; System.SysUtils.DecodeDate(Present, Year, Month, Day); Label1.Caption := 'Today is Day ' + IntToStr(Day) + ' of Month ' + IntToStr(Month) + ' of Year ' + IntToStr(Year); end; .. and get this same error. The 'Word' is red-underlines as the error. I have System.SysUtils in the Uses clause: uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, ... etc I have used this same code in a different project and it works with no error. I can't think of why it isn't working in this particular project. Unless some other unit in the Uses clause is causing a problem, although SysUtils comes almost first. Any thoughts would be welcomed.
  17. Hi, friends Im with a little problem. Im trying to create a delphi Dll with a form in RAD Studio, but i don't know how to make it load with DllMain. I want to inject this Dll in a third-party process at runtime after. I created the Dll project with the form without problems, but i can't find nothing good related to "how to load it with DllMain", or at least the tutorials/things i found doesn't helped me (or i'm just dumb ). Can someone help me? Give me some hint or a site/video where i can learn it? Thanks for your time guys! =)
  18. We have open sourced our Deployment Manager to simplify deployment of a large number of files or folders to iOS or Android. https://blog.grijjy.com/2021/02/07/deployman/
  19. Hello, We are looking for a Delphi Object Pascal Developer. Our system is entirely based on it, and some updates are needed. We are located in Morocco but remote work is an option. (Long term project). Please respond if interested.
  20. Hi, I'm experimenting some interface design and came up with the following: I would like to query a BaseClass instance if it supports a given interface, without freeing the class! As the example below, my great grand child class can support an interface, but I don't want to include the class definition ( great grand child class ) in the Base class.. So, by defining interfaces, I can write exactly what I want: TMyFrame = Class( TBaseFrame, {SupportedInterfaces}) In the code below procedure TForm22.Button1Click(Sender: TObject); begin if Supports( fBaseFrameClass, ISupportTask ) then (fBaseFrame as ISupportTask).CheckTask; end; No matter what overload Support method I call, fBaseFrame is freed once the method exits. Is there a way to know if my class instance supports an interface and call the corresponding method without messing ref counting and free the class instance prematurely? unit frm.main; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type ISupportTask = Interface ['{3F785F20-7C44-4163-B55C-5EA267C7204E}'] function CheckTask : Boolean; end; ISupportList = Interface ['{9B7D95E1-DA96-475A-9A1C-910CAF99E5F5}'] function ListCount : Integer; End; ISupportItem = Interface ['{ACADFA2F-3500-4ACB-8049-F49FAC38EFB2}'] function SaveItem : Boolean; End; TBaseFrame = Class( TInterfacedObject ) protected fDummy : Boolean; End; TBaseFrameClass = Class of TBaseFrame; TMyFrame = Class( TBaseFrame, ISupportTask, ISupportList, ISupportItem ) public function CheckTask : Boolean; function ListCount : Integer; function SaveItem : Boolean; destructor Destroy; override; End; TForm22 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); private { Private declarations } fBaseFrameClass : TBaseFrameClass; fBaseFrame : TBaseFrame; public { Public declarations } end; var Form22: TForm22; implementation {$R *.dfm} procedure TForm22.Button1Click(Sender: TObject); begin if Supports( fBaseFrameClass, ISupportTask ) then (fBaseFrame as ISupportTask).CheckTask; end; { TMyFrame } function TMyFrame.CheckTask: Boolean; begin Result := True; end; destructor TMyFrame.Destroy; begin fDummy := True; inherited; end; function TMyFrame.ListCount: Integer; begin Result := 42; end; function TMyFrame.SaveItem: Boolean; begin Result := False; end; procedure TForm22.FormCreate(Sender: TObject); begin fBaseFrameClass := TMyFrame; fBaseFrame := fBaseFrameClass.Create; end; procedure TForm22.FormDestroy(Sender: TObject); begin fBaseFrame.Free; end; end.
  21. shineworld

    AnsiPos and AnsiString

    Hi all. I'm getting crazy with old software (Delphi 2006) port to Sydney about AnsiPos of an AnsiString: function TTCPBin01.GetTargetAnswer: AnsiString; begin Result := FTargetAnswer; end; .. .. if AnsiPos('?y', GetTargetAnswer) <> 0 then begin FErrorCode := sigc_None; FErrorMessage := SignalMessage(FErrorCode); Result := qmct_Prog; end GetTargetAnswer return an AnsiString. Also using AnsiPos to check for a substring in the resulting string the compiler notice me: [dcc32 Warning] osTCPBin01.pas(224): W1057 Implicit string cast from 'AnsiString' to 'string'. Placing the mouse cursor on AnsiPos the HINT some time notice me: function (const SubStr: string; const S: string): Integer; Other times notice me: function (const SubStr: AnsiString; const S: AnsiString): Integer; In either case however the compiler notice Implicit cast... Have you any suggestion about? Best regards Silverio Diquigiovanni
  22. Some one is asking for my themes, so I thought its better to create a new post to benefit any one who like them, I called them "Nature" themes, one Nature original theme and one Nature Warm theme, you may use Delphi IDE theme editor (https://github.com/RRUZ/delphi-ide-theme-editor) to apply them: Please click Like if you enjoy it. Nature warm (based on my Nature original theme): File: c0d3r-YW-Nature-warm.theme.xml
  23. PrimeMinister

    Problem with clearing ADO Tables

    Hey guys, so I'm having a problem with my ADO Tables. I have a button in my program that is meant to clear all tables in the database related to the program when clicked but whenever I click it, it gives errors. (no matter how many times I change my code) Could it be a problem with my Data Module or what? (I'm not sure cause my button which saves stuff to the database, works perfectly without a hitch) How could I alleviate this? Code of my data module: const scConnectionString = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%pathtomdb%Racers.mdb;Mode=ReadWrite;Persist Security Info=False;'; var dmRacers: TdmRacers; implementation {%CLASSGROUP 'Vcl.Controls.TControl'} {$R *.dfm} procedure TdmRacers.DataModuleCreate(Sender: TObject); var path:string; begin path:=ExtractFilePath(ParamStr(0)); conToDB.ConnectionString := StringReplace(scConnectionString, '%pathtomdb%', path, []); conToDB.Connected:=True; tbl1660.Active := True; tblXKarts.Active := True; tblTwoPointOne.Active := True; tblMidB.Active := True; tblMidA.Active := True; tblLateModel.Active := True; tblSprints.Active := True; tblV8.Active := True; tblHeavyMetals.Active := True; tblHotrods.Active := True; tblPinkrods.Active := True; tblStockrods.Active := True; tblMinis.Active := True; tblDevelopment.Active := True; end; Code from the form: public { Public declarations } MyCmd:TADOCommand; procedure EmptyTable(tbl:TADOTable;tablename:string); procedure ResetActiveProp(tbl:TADOTable); end; var frmEntry: TfrmEntry; implementation {$R *.dfm} procedure TfrmEntry.ResetActiveProp(tbl: TADOTable); begin tbl.Active := True; end; procedure TfrmEntry.EmptyTable(tbl: TADOTable; tablename: string); var MyCmd: TADOCommand; begin tbl.Active := true; MyCmd.CommandText := 'Delete * from '+tablename; MyCmd.Execute; tbl.Active := false; end; procedure TfrmEntry.bmbClearClick(Sender: TObject); var i:integer; begin cbxGridSelect.ItemIndex:=-1; cbxGridSelect.Text:='Select a class'; edtRacerName.Clear; edtCarNumber.Clear; edtLicenseNum.Clear; i:=MessageDlg('Dialog cleared',mtInformation,[mbOK],0); end; procedure TfrmEntry.bmbClearDBClick(Sender: TObject); var i:integer; begin i:=MessageDlg('Are you sure you want to clear the Racers database? (all current data in the database will be lost.)',mtWarning,[mbOK,mbCancel],0); if i = mrOk then begin //clears entire database with dmRacers do begin EmptyTable(tbl1660,'tbl1660'); EmptyTable(tblXKarts,'tblXKarts'); EmptyTable(tblTwoPointOne,'tblTwoPointOnes'); EmptyTable(tblMidB,'tblMidB'); EmptyTable(tblMidA,'tblMidA'); EmptyTable(tblLateModel,'tblLateModels'); EmptyTable(tblSprints,'tblSprints'); EmptyTable(tblV8,'tblV8'); EmptyTable(tblHeavyMetals,'tblHeavyMetals'); EmptyTable(tblHotrods,'tblHotrods'); EmptyTable(tblPinkrods,'tblPinkrods'); EmptyTable(tblStockrods,'tblStockrods'); EmptyTable(tblMinis,'tblMinis'); EmptyTable(tblDevelopment,'tblDevelopment'); i:=MessageDlg('Database successfully cleared',mtInformation,[mbOk],0); //resets active property of tables ResetActiveProp(tbl1660); ResetActiveProp(tblXKarts); ResetActiveProp(tblTwoPointOne); ResetActiveProp(tblMidB); ResetActiveProp(tblMidA); ResetActiveProp(tblLateModel); ResetActiveProp(tblSprints); ResetActiveProp(tblV8); ResetActiveProp(tblHeavyMetals); ResetActiveProp(tblHotrods); ResetActiveProp(tblPinkrods); ResetActiveProp(tblStockrods); ResetActiveProp(tblMinis); ResetActiveProp(tblDevelopment); end; end else begin i:=MessageDlg('Clear aborted',mtInformation,[mbOk],0); end; end; Example of errors: Thanks in advance for the help! Kind Regards PrimeMinister
  24. DieselDave

    Compiler Error E2217

    Is anyone having problems with Delphi 10.3.3 - getting compiler error messages E2217 : Published field not class or interface type. It occurs against the first (and every subsequent field) in the first class definition in a unit ? This has compiled ok before but now it is driving me mad - any Suggestion as to what is wrong would be welcomed. Dave M
  25. Hello, I get a problem with running RestDebugger on my Windows 10 after it was updated. I get such error: and its stops (not working) It's weird and its on all version I have on my installed from Delphi XE8 to 10.4 . I also download free RestDebugger (tool from embarcadero web page and I get error too but it's bit different) Windows 10 Pro version: 20H2 compilation: 19042.746 Can someone confirm or know solution ? best regards Moskw@