Noutați

Learn How To Modernize And Integrate WinAPI, COM, ShellAPI, And WinRT Into Your Windows VCL Applications

In this webinar, learn how to access all the APIs on Windows 10 from RAD Studio, Delphi, and C++Builder. Overview Traditional Core APIs Shell Integration WinRT and more Windows API Evolution Over Time Classic API 1985 (Win1) Win16 -> Win32 -> Win32(w/Unicode) -> Win64 COM, OLE Automation, Shell, etc WinRT Classic Windows API Kernel, User, GDI Delphi bindings for the Windows API (C language API) Load time linking vs. dynamic invocation vs. delay loading Message handling TWinControl Delphi TWinControl Wraps Windows handles, CreateWindows, API calls Used for platform controls and custom controls Used for form The entire VCL library wraps Windows APIs, plus some native concepts Component inheritance, actions, visual form inheritance, frames, styling, component messages, delayed creation, handle re-creation Be sure to check out the whole session to learn about COM, Interfaces, Shell integration concepts, and modern WinRT. Moreover, TaskBar and JumpList components in action.  Learn more about the Delphi VCL and Windows development in the Embarcadero DocWiki.

Read More

Installing Component Packages Manually

Sometimes you need to install components manually. Maybe the installer wasn’t updated for your version of Delphi, or it is an open-source library without an installer. Whatever the reason, here is a short guide in addition to what is found in the DocWiki on the topic. I’m going to write this guide around installing the Radiant Shapes Pack available via GetIt. I’m guessing it wasn’t updated to install in 10.4 yet, and while R&D is working on that this is a great opportunity to learn how to install it manually. After installing from GetIt, you will not find it in the IDE, and it is missing from the packages list, which you access from Component 🡆 Install Packages while no project is open This is where all the BPL Packages are listed. Click the Add button and browse to find the BPL C:Program Files (x86)RaizeRadiantShapes1.4BinRadiantShapesFmx_Design270.bpl (If you don’t have that BPL or path for Radiant Shapes, then make sure you installed from GetIt and you can run the installer manually from C:UsersPublicDocumentsEmbarcaderoStudio21.0CatalogRepositoryRadiantShapes-270-1.2InstallerRadiantShapes.exe ) or whatever design-time package you need. This will install the components into the IDE. Many projects have both design time and runtime packages. A design-time package contains the information necessary to install in the IDE, and any special designers, while RunTime packages only contain the code necessary for use during RunTime. You can optionally even ship these packages with your binary to link them at runtime. Next, you need to tell the IDE where to find the DCUs and optionally source files. What if you only have source files? No problem, open and build all the packages at least in Release Mode on each platform the library suports. Then head to Tools 🡆 Options then Language 🡆 Delphi 🡆 Library. Then complete the details for each platform you built and want to support: Selected Platform – Specifies which platform you are providing details for below: Linux 64-bit, iOS 64-bit, Win 32-bit, Win 64-bit, macOS 64-bit, Android 32-bit, Android 64-bit, and/or iOS Simulator. Library Path – This is the path to the Release DCUs. Some people point to their PAS files here, which works, but then you end up recompiling the library more than necessary. Radiant Shapes includes all the DCUs in subfolders off the path C:Program Files (x86)RaizeRadiantShapes1.4Lib Tip: Paste the new path into the edit box before clicking the browse button if you need to browse to a subfolder. Then be sure to click [Add] when you are done. Library Paths Dialog Location of platform specific DCU folders for Radiant ShapesC:Program Files (x86)RaizeRadiantShapes1.4Lib Browsing Path is where you optionally add a path to the source PAS files. This lets you browse out to those source files from the IDE with the Find Declaration context menu item. For Radiant Shapes, the source is found in C:Program Files (x86)RaizeRadiantShapes1.4Source Debug DCU Path allows you to optionally point to the debug version of the DCUs. This is useful if the debug version has additional information or different behaviors. Radiant Shapes doesn’t have special debug DCUs so we don’t need to add anything here. Once you’ve completed these settings for each platform you are good to go! Happy installing!

Read More

Powerful PyDelphiWrapper To Wrap Your Delphi Objects To Python Objects Instantly With FireDAC Sample App

How about wrapping your Delphi Objects to Python Objects with a single line of code? Sounds Interesting? Yes, Python4Delphi has the flexibility to do that using a TPyDelphiWrapper component. This benefits Delphi Developers easily to wrap the existing or new Delphi Objects into Python Objects. This post will guide you on how to wrap a FireDAC TFDTable to a python Object and Manipulates with table data using python scripts. You can also use Python4Delphi with C++Builder. Python4Delphi Demo10_FireDAC Sample App shows how to wrap a Delphi Object(TFDTable, TFDQuery) to Python Object with some Examples as listed. You can find the Demo10_FireDAC source on GitHub. Prerequisites: Download and install the latest Python for your platform. Follow the Python4Delphi installation instructions mentioned here. Alternatively, you can check out this video Getting started with Python4Delphi. Components used in Python4Delphi Demo10_FireDAC App: TPythonEngine: A collection of relatively low-level routines for communicating with Python, creating Python types in Delphi, etc. It’s a singleton class. TPythonGUIInputOutput: Inherited from TPythonInputOutput (which works as a console for python outputs) Using this component Output property you can associate the Memo component to show the Output. TPythonModule: It’s inherited from TMethodsContainer class allows creating modules by providing a name. You can use routines AddMethod, AddMethodWithKW to add a method of type PyCFunction. You can create events using the Events property. TPyDelphiWrapper: Component that wraps the Delphi Object to Python Object inherited from TEngineClient. It has the capability to store Delphi class registration information, registration for Helper Types(not correspond to Delphi Classes), register python module functions, created event handlers. Wrap, WrapRecord, WrapInterface are the key methods to wrap Delphi Object, Record, and Interface respectively. TSynEdit: Syntax highlighting edit control, not based on the Windows common controls and supported on Windows. For some history check here. How to get and use SynEdit check here. TMemo: A multiline text editing control, providing text scrolling. The text in the memo control can be edited as a whole or line by line. Along with these components TFDConnection,TFDTable,TFDQuery, TDataSource were used. You can find the Python4Delphi Demo10_FireDAC sample project from the extracted GitHub repository ..Python4DelphiDemosDemo10_FireDAC.dproj. Open this project in RAD Studio 10.4.1 and run the application.- Implementation Details: PythonEngine component provides the connection to Python or rather the Python API. This project uses Python3.9 which can be seen in TPythonEngine DllName property. PythonGUIInputOutput component provides a conduit for routing input and output between the Graphical User Interface (GUI) and the currentlyexecuting Python script. PyDelphiWrapper component contains Module and Engine Property which is associated with PythonEngine and modDBFireDAC respectively. In Example 1, SynEditScript1 load the Python script file Example1.py and clicking Execute Button, connected to the database selected in the Combobox, and the script is executed. Example1.py imports the module modDBFireDAC, create an own TFDTable object, and manipulates the table values mentioned in the script. procedure TMain.btnExecuteExample1Click(Sender: TObject); var l_sConnName: String; begin l_sConnName := cobxConnSQLServer.Items[cobxConnSQLServer.ItemIndex]; if self.DBConnectionClosedCheck(l_sConnName) then begin with GetPythonEngine do begin ExecStrings( SynEditScript1.Lines ); end; end; end; procedure TMain.btnExecuteExample1Click(Sender: TObject); var l_sConnName: String; begin l_sConnName := cobxConnSQLServer.Items[cobxConnSQLServer.ItemIndex]; if self.DBConnectionClosedCheck(l_sConnName) then begin    with GetPythonEngine do begin      ExecStrings( SynEditScript1.Lines );    end; end; end; In Example 2, SynEditScript2 loads the Python script file Example2.py and clicking Execute Button, the script is executed. Example2.py imports the module modDBFireDAC shows you how to create a TFDTable object connected to an already created Delphi TFDTable (which may include calculated fields and the like). procedure TMain.btnExecuteExample2Click(Sender: TObject); […]

Read More

TMS FNC Planner Editing

Intro Since the first release, TMS FNC UI Pack has been constantly evolving. Version 3.2 added a lot of great new functionality and new components (https://tmssoftware.com/site/blog.asp?post=695). Today, we wanted to focus on a component that has been there since v1.0: TTMSFNCPlanner. The TTMSFNCPlanner is a scheduling component with various built-in time-axis options, i.e. a day, week, month, period, half-day period, timeline as well as custom time-axis mode where you can fully control the duration of each timeslot. The TTMSFNCPlanner supports single and multi resource views and can have the time-axis in horizontal or vertical orientation. Even when targeting mobile devices, the TTMSFNCPlanner will automatically use a touch-friendly approach. Today’s blog post focuses on a feature that is essential for an application that uses the maximum potential TTMSFNCPlanner has to offer: editing. Editing Editing is divided into 3 parts: Inplace editing Dialog editing Custom editing Inplace editing Inplace editing is enabled by default. Clicking in the planner item notes area will start the inplace editor. The default inplace editor is a TMemo, but can be configured to whatever inplace editor you want to use, with the OnGetInplaceEditor event. See the topic “Custom editing” below for an example. After the editor is started, text can be entered, and committed via the F2 key, or by clicking on another part of the planner. Cancelling is done via the Escape key. Changing the behavior of inplace editing can be done via one of the various properties under Interaction. Dialog editing Dialog editing can be enabled by changing the property Interaction.UpdateMode to pumDialog. When doing the same kind of interaction (selecting the item, clicking on the notes area), the dialog will be shown which can fully edit the item. Whereas inplace editing can only edit the notes, the dialog can edit title, notes, start & end time of the item. There is also support for a built-in recurrency editor dialog, which offers the same basic features as the default dialog, and extends this with recurrency options. This is typically used in combination with a dataset (see planner database demo included in the distribution). To use this dialog editor, you can drop an instance of TTMSFNCPlannerItemEditorRecurrency on the form, assign it to the ItemEditor property and click on the item to show the editor, as you would normally do after setting Interaction.UpdateMode to pumDialog. Custom editing For both of the above editing types, customization is possible. Let’s start with inplace editing. We want to create a custom editor that uses a TTMSFNCRichEditor and a TTMSFNCRichEditorFormatToolBar. We start by implementing a custom class wrapper that creates and holds a reference to a set of richeditor related classes for importing and exporting HTML as well as a toolbar and the richeditor itself. The planner item supports HTML and we need a way to convert the HTML coming from the item to the rich editor and vice versa. type TCustomInplaceEditor = class(TTMSFNCCustomControl) private FHTMLImport: TTMSFNCRichEditorHTMLIO; FRichEditor: TTMSFNCRichEditor; FRichEditorToolBar: TTMSFNCRichEditorFormatToolBar; FScrollBox: TScrollBox; public constructor Create(AOwner: TComponent); override; end; implementation { TCustomInplaceEditor } constructor TCustomInplaceEditor.Create(AOwner: TComponent); begin inherited; FScrollBox := TScrollBox.Create(Self); FScrollBox.Parent := Self; FScrollBox.Align := TAlignLayout.Client; FRichEditor := TTMSFNCRichEditor.Create(FScrollbox); FRichEditor.Parent := FScrollbox; FRichEditorToolBar := TTMSFNCRichEditorFormatToolBar.Create(FScrollbox); FRichEditorToolBar.RichEditor := FRichEditor; FRichEditorToolBar.Parent := FScrollbox; FRichEditor.Position.Y := FRichEditorToolBar.Height; FRichEditor.Width := FRichEditorToolBar.Width; FHTMLImport := TTMSFNCRichEditorHTMLIO.Create(Self); FHTMLImport.RichEditor := FRichEditor; end; To show the new inplace editor, […]

Read More

Introduction to Cyber Threat Intelligence

Published November 11, 2020 WRITTEN BY ED TITTEL. Ed Tittel is a long-time IT industry writer and consultant who specializes in matters of networking, security, and Web technologies. For a copy of his resume, a list of publications, his personal blog, and more, please visit www.edtittel.com or follow @EdTittel Simply put, threat intelligence – also known as cyber threat intelligence, or CTI – is information that is collected, analyzed, organized, and refined to provide insight, input, and advice about potential and current security threats or attacks that could pose potential or actual risks to an organization. CTI covers a wide range of information sources and can involve reports of attacks obtained from security telemetry in cybersecurity software, from researchers conducting experiments, and even from automated security testing tools (e.g. fuzzing) that automate repeated variations on accepted or expected inputs into systems and software. Threat intelligence feeds: free and open source Gathering and providing threat intelligence often occurs in the form of various “feeds.” These are continuous, ongoing streams of data about threats that incorporate information items about newly-discovered threats along with updates and amendments to information about known existing threats. Threat intelligence feeds are an important part of modern cybersecurity best practices, and may include information about countering or working around individual threats (often called “remediation advice”). In general, threat intelligence feeds fall into two broad categories. First and most widely consumed are those identified as free or open source security feed options. These are available to all interested parties and may be consumed without incurring costs for their uptake and use (though they are subject to licensing conditions about which prospective consumers should make themselves aware). Searching the Web for “best open source threat intelligence feeds” is a good way to identify such things, given that there are hundreds of such feeds from which cybersecurity service and software providers and interested organizations can choose. Here’s an example “Top 10 List” from D3 Security: Kiuwan draws much of its Open Source Security data from the NIST NVD (National Vulnerability Database), which is another widely-used and -respected free and open source security feed. Threat intelligence feeds: commercial options Working with free, open source intelligence feeds involves a wide-open, no-holds-barred outlook on converage, content, and quality. Working with such feeds requires a fair amount of work to separate the wheat from the chaff – that is, to filter out inputs and information that is not relevant to the exposures and vulnerabilities actually present in one particular organization or another. Commercial CTI feeds let customers – who can pay upwards of US$1,500 a month per feed for such access – establish and maintain filtering criteria to make sure they see only information of direct and immediate relevance to the hardware, software, and systems present in their organizations. According to Technology Comparison and Rating company CompariTech, the top 6 such producers  are as follows: The interesting thing about threat feed consumption is that most such feed come in multiple tiers – at progressively higher monthly costs – and really target enterprise-scale organizations and security service and software providers. Unless you have a team of security researchers and analysts (and a sizable budget to support their direct and indirect costs – including commercial security feeds) this will be more than most organizations are willing to […]

Read More

Quick Introduction To FireDAC And Its Features For Building Robust Delphi/C++ Builder Database Applications.

FireDAC is a powerful, yet easy-to-use access layer that supports, abstracts, and simplifies data access, providing all the features needed to build real-world high-load applications. FireDAC provides a common API for accessing different database back-ends, without giving up access to unique database-specific features and without compromising on performance. Use FireDAC in Android, iOS, Windows, and Mac OS X applications you are developing for PCs, tablets and smartphones. FireDAC Design Objectives and Architecture : FireDAC enables native high-speed direct access from Delphi and C++Builder.  Provides Universal Data Access i.e) Application built for a single data base can be used for other databases with very minimal changes at configuration. Highly configurable, using this you can fine tune your data access and it is important how your Software access with databases. Simple to deploy as no specific driver required, along with executable it is built. FireDAC local/embedded connectivity to certain local databases, including Microsoft Access database, SQLite database, InterBase ToGo / IBLite, InterBase on localhost, MySQL Embedded, MySQL Server on localhost, Advantage Database local engine, PostgreSQL on localhost, Firebird Embedded, and Firebird on localhost. Full source code provided, Developers can understand the underlying design and source code. Compatibility with the BDE means easy migration of legacy applications with reFind Utility. FireDAC Architecture Supported Database : InterBase, SQLite, MySQL, SQL Server, Oracle, PostgreSQL, IBM DB2, SQL Anywhere, Access, Firebird, Informix and more. Working With Database connections : Option 1: You can connect with any of the above listed Databases either from a Local Machine or Remote DBMS machine using the Data Explorer in the IDE. It is a tabbed pane that is located, along with the Projects Window and the Model View tabs, in the upper-right corner of the IDE window. Can use this, to create new connections, modifies, deletes, or renames your database connections.  The Data Explorer works for databases that use dbExpress or FireDAC connection types. The Data Explorer lets you browse database server-specific schema objects, including tables, fields, stored procedure definitions, stored functions, triggers, and indexes. FireDAC databases also display primary keys, foreign keys and generators. The Data Explorer presents a list of available database types (such as DATASNAP and MYSQL) that you can access and perform various actions on, using the context menus. With Data Explorer, you can easily create and manage database connections. Additionally, you can drag and drop data from a data source to a project to build your database application quickly. The commands available in the Data Explorer depend upon the object selected in the tree view. To display the associated context menu commands, right-click the following node types: You can also use Data Explorer to Obtain connection information, Check here. Option 2 : Create/Modify the connection via TFDconnection component by double clicking which will shows the editor same as Data explorer, where you can provide the DriverId, Username, Database name, Password etc. The connection string is stored in the TFDConnectionDefsparams and it is binded with application as hard-coded values. What if the database path changes after deployment of the application, you need to rebuild to avoid error in connection. To avoid such hard coded connection information, we can select the Connection Definition name in the TFDConnection editor, where Connection definition name need to be predefined and stored in the FDConnectiondefs.Ini file. The connection definitions for different databases are stored in the following fpath. C:UsersPublicDocumentsEmbarcaderoStudioFireDACFDConnectionDefs.ini To create TFDconnection with connection information, a clever way […]

Read More

Robust Way to Find Leaks With Deleaker In Delphi and C++Builder Applications

It’s quite normal for a developer to forget to destroy or free the objects while developing, these small memory leaks over a period of time lead the application to crash with, out of memory error. Finding that memory leaks in small projects it is easy. How about finding the leaks in large enterprise applications? Tired of finding the leaks? Don’t worry. The Deleaker solves the problem for you in a robust way. Find all the memory leaks, It doesn’t matter what type of leaks are occurring, Deleaker will find them all: memory leaks (produced by the heap, virtual memory, or OLE allocators, etc.), GDI leaks, leaks of Windows USER objects, and handles. Deleaker detects leaks in Delphi and C++ Builder. It can work either as a standalone application or as a RAD Studio extension. Standalone is convenient, for example, if RAD Studio is not installed. If Deleaker works as an extension, a developer can search for leaks without leaving RAD Studio, which lets him move to the source of possible errors quicker. After installation, a new Deleaker item is added to the RAD Studio main menu: How to use the Deleaker : Install the Deleaker setup check here. While installing choose the options as standalone or integration with RAD studio. Create a sample windows VCL application and write a piece of code with some memory leaks in it. Run the application, perform the action to create memory leaks, and close the application. Deleaker will create a snapshot of memory leaks where you can navigate to the line of code from the snapshot window directly to IDE. It’s that simple identify the memory leaks. Check the samples and resources available here. Check this below video demonstration of Deleaker for Delphi and C++ builder.

Read More

Quickly Learn To Use Delphi Classes To Create A New Python Type With Python4Delphi Sample App

import spam p = spam.CreatePoint(2, 5) print (p) p.OffsetBy( 3, 3 ) print (p.x, p.y) print (dir(spam)) print (spam.Point) print (“p = “, p, ”  –> “,) if type(p) is spam.Point:   print (“p is a Point”) else:   print (“p is not a point”) p = 2 print (“p = “, p, ”  –> “,) if type(p) is spam.Point:   print (“p is a Point”) else:   print (“p is not a point”) p = spam.CreatePoint(2, 5) try:   print (“raising an error of class EBadPoint”)   p.RaiseError() # it will raise spam.EBadPoint except spam.PointError as what: #it shows you that you can intercept a parent class   print (“Caught an error derived from PointError”)   print (“Error class = “, what.__class__, ”     a =”, what.a, ”   b =”, what.b, ”   c =”, what.c)   # You can raise errors from a Python script too! print (“——————————————————————“) print (“Errors in a Python script”) try:   raise spam.EBadPoint(“this is a test !”) except:   pass   try:   err = spam.EBadPoint()   err.a = 1   err.b = 2   err.c = 3   raise err except spam.PointError as what: #it shows you that you can intercept a parent class   print (“Caught an error derived from PointError”)   print (“Error class = “, what.__class__, ”     a =”, what.a, ”   b =”, what.b, ”   c =”, what.c)   if p == spam.CreatePoint(2, 5):   print (“Equal”) else:   print (“Not equal”)

Read More

Astral Heroes Is A Beautiful Multiplayer Collectible Card Game Built In Delphi

Developer Ivan Polyacov from Apus Software created Astral Heroes in Delphi. According to the site it is a collectible card game that’s simple to learn, exciting to play, and deep enough to challenge even the greatest strategists. It uses a truly fair Free-­to-­Play model that never hides the best content behind “pay walls” according to the developer. Some of the features of this beautiful game include: Fast-paced and simple core gameplay, 3 different game modes, Custom Decks: Construct and play a deck of your own personal design, Random Decks, Draft Tournament, a deep library of well­ balanced creatures and spells, A global Online League, Sophisticated and merciless AI opponents that will test your mettle, and a rich single ­player campaign. If you want to find out more about why Ivan selected Delphi and more about this development process check out this YouTube code review video. Website http://astralheroes.com/ Download https://store.steampowered.com/app/488910/Astral_Heroes/ Open Source Game Engine https://github.com/Cooler2/ApusGameEngine Screenshot Gallery

Read More

Delphi at the University – DelphiCon 2020

Are you a teacher, educator, or parent of a child interested in programming?  Are you looking for a simple but powerful language and student-friendly integrated development environment? With it’s combination of full-language features, simple syntax, and visual drag-and-drop development, Delphi rocks its competition. Still unsure? Let Victory Fernandes, a former mathematics and computer science professor at Brazil’s Unifacs University, walk you through the benefits of Delphi in education in his talk Delphi at the University – Insights for Students and Teachers. This presentation and Q&A session is free of charge and bundled with nine other talks and four panels by industry professionals.  Sign up now by clicking the “Save my seat” button at delphicon.embarcadero.com.

Read More