Noutați

Quickly Learn About The Ultimate Open Tools APIs For Decorating Your Delphi/C++ Builder IDE

Though RAD Studio IDE supports a lot of features to boost productivity sometimes as a Delphi/C++ Builder Developer and as an end-user we may think to modify/extend the IDE capabilities for our own custom needs. Don’t know where to start with? Don’t worry! Delphi/C++ Builder has the Flexibility to extend the IDE capabilities using the Open Tools API. Using this Developers can extend some text, graphics, and installs to the IDE. Open Tools API (OTA) The Open Tools API (OTA) is a set of interfaces that allow developers to add features to the BDS, Delphi, and C++Builder IDEs. These additions are called wizards or experts. Wizards can use the OTA interfaces to modify the IDE, obtain information about the IDE’s state, and receive notification of important events. Check some useful FAQs here How to decorate your Editor using OTA: e.g) Need to do visualization of code coverage in the Delphi Source editor with some Text and Graphics representation. How to decorate your IDE with symbols and graphics to the Source editor? How to make sure that these decorations are in sync when editing the content? In ToolsAPI.pas, a lot of interfaces available to Modify IDE, information about IDE’s state, etc. For Visualizing code coverage in the Source editor, use the INTAEditViewNotifier interface PaintLine procedure. Create the Canvas state and draw the graphics required in the implementation of the procedure. procedure PaintLine(const View: IOTAEditView; LineNumber: Integer; const LineText: PAnsiChar; const TextWidth: Word; const LineAttributes: TOTAAttributeArray; const Canvas: TCanvas; const TextRect: TRect; const LineRect: TRect; const CellSize: TSize); procedure PaintLine(const View: IOTAEditView; LineNumber: Integer; const LineText: PAnsiChar; const TextWidth: Word; const LineAttributes: TOTAAttributeArray; const Canvas: TCanvas; const TextRect: TRect; const LineRect: TRect; const CellSize: TSize); BeginPaint is called before the code editor is repainted, and use the EndPaint procedure to clean up any data structures that have been maintained over the course ofpainting lines. Check the below Video Demonstration for decorating the Source Editor. https://www.youtube.com/watch?v=wlH4IVrhqRQ

Read More

Building a C++ VCL Customer/Sales Master/Detail/Charting Application with 1 Line of Code

object MasterDetailForm: TMasterDetailForm   Left = 0   Top = 0   Caption = ‘Customer and Orders Master Detail Using Live Bindings (C++ VCL)’   ClientHeight = 509   ClientWidth = 736   Color = clBtnFace   Font.Charset = DEFAULT_CHARSET   Font.Color = clWindowText   Font.Height = –11   Font.Name = ‘Tahoma’   Font.Style = []   OldCreateOrder = False   OnShow = FormShow   PixelsPerInch = 96   TextHeight = 13   object Splitter1: TSplitter     Left = 0     Top = 161     Width = 736     Height = 3     Cursor = crVSplit     Align = alTop     ExplicitLeft = 24     ExplicitTop = 210     ExplicitWidth = 159   end   object Panel1: TPanel     Left = 0     Top = 0     Width = 736     Height = 33     Align = alTop     TabOrder = 0     object DBNavigator1: TDBNavigator       Left = 159       Top = 4       Width = 225       Height = 23       DataSource = CustomerDataSource       VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast, nbRefresh]       TabOrder = 0     end     object DatabaseActiveCheckBox: TCheckBox       Left = 24       Top = 9       Width = 97       Height = 17       Caption = ‘Database Active’       TabOrder = 1     end   end   object CustomerDBGrid: TDBGrid     Left = 0     Top = 33     Width = 736     Height = 128     Align = alTop     DataSource = CustomerDataSource     TabOrder = 1     TitleFont.Charset = DEFAULT_CHARSET     TitleFont.Color = clWindowText     TitleFont.Height = –11     TitleFont.Name = ‘Tahoma’     TitleFont.Style = []   end   object Panel2: TPanel     Left = 0     Top = 164     Width = 736     Height = 345     Align = alClient     TabOrder = 2     object Splitter2: TSplitter       Left = 305       Top = 1       Height = 343       ExplicitLeft = 208       ExplicitTop = 120       ExplicitHeight = 100     end     object SalesDBGrid: TDBGrid       Left = 1       Top = 1       Width = 304       Height = 343       Align = alLeft       DataSource = SalesDataSource       TabOrder = 0       TitleFont.Charset = DEFAULT_CHARSET       TitleFont.Color = clWindowText       TitleFont.Height = –11       TitleFont.Name = ‘Tahoma’       TitleFont.Style = []     end     object DBChart1: TDBChart       Left = 308       Top = 1       Width = 427       Height = 343       Title.Text.Strings = (         ‘Sales by Item Type for Customer’)       View3DOptions.Elevation = 315       View3DOptions.Orthogonal = False       View3DOptions.Perspective = 0       View3DOptions.Rotation = 360       Align = alClient       TabOrder = 1       DefaultCanvas = ‘TGDIPlusCanvas’       ColorPaletteIndex = 13       object Series1: TPieSeries         DataSource = SalesByItemTypeForCustomerQuery         XLabelsSource = ‘ITEM_TYPE’         XValues.Order = loAscending         YValues.Name = ‘Pie’         YValues.Order = loNone         YValues.ValueSource = ‘SUM’         Frame.InnerBrush.BackColor = clRed         Frame.InnerBrush.Gradient.EndColor = clGray         Frame.InnerBrush.Gradient.MidColor = clWhite         Frame.InnerBrush.Gradient.StartColor = 4210752         Frame.InnerBrush.Gradient.Visible = True         Frame.MiddleBrush.BackColor = clYellow         Frame.MiddleBrush.Gradient.EndColor = 8553090         Frame.MiddleBrush.Gradient.MidColor = clWhite         Frame.MiddleBrush.Gradient.StartColor = clGray         Frame.MiddleBrush.Gradient.Visible = True         Frame.OuterBrush.BackColor = clGreen         Frame.OuterBrush.Gradient.EndColor = 4210752         Frame.OuterBrush.Gradient.MidColor = clWhite         Frame.OuterBrush.Gradient.StartColor = clSilver         Frame.OuterBrush.Gradient.Visible = True         Frame.Width = 4         OtherSlice.Legend.Visible = False       end     end   end   object DatabaseConnection: TFDConnection     Params.Strings = (                ‘Database=C:UsersPublicDocumentsEmbarcaderoStudio21.0Sampl’ +         ‘esDataEMPLOYEE.GDB’       ‘ConnectionDef=EMPLOYEE’)     Connected = True     LoginPrompt = False     Left = 104     Top = 64   end   object CustomerQuery: TFDQuery     AfterScroll = CustomerQueryAfterScroll     Connection = DatabaseConnection     SQL.Strings = (       ‘select * from customer’)     Left = 240     Top = 72     object CustomerQueryCUST_NO: TFDAutoIncField       FieldName = ‘CUST_NO’       Origin = ‘CUST_NO’       ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]       IdentityInsert = True     end     object CustomerQueryCUSTOMER: TStringField       FieldName = ‘CUSTOMER’       Origin = ‘CUSTOMER’       Required = True       Size = 25     end     object CustomerQueryCITY: TStringField       FieldName = ‘CITY’       Origin = ‘CITY’       Size = 25     end     object CustomerQuerySTATE_PROVINCE: TStringField       FieldName = ‘STATE_PROVINCE’       Origin = ‘STATE_PROVINCE’       Size = 15     end     object CustomerQueryCOUNTRY: TStringField       FieldName = ‘COUNTRY’       Origin = ‘COUNTRY’       Size = 15     end     object CustomerQueryPOSTAL_CODE: TStringField       FieldName = ‘POSTAL_CODE’       Origin = ‘POSTAL_CODE’       Size = 12     end     object CustomerQueryON_HOLD: TStringField       AutoGenerateValue = arDefault       FieldName = ‘ON_HOLD’       Origin […]

Read More

Web Application Development using Delphi/C++ Builder

Choosing the Web framework for Delphi/C++ Builder will no longer be a tough task for developers or companies to meet the business needs. There is plenty of resources around Embarcadero and the web about various frameworks with the pros and cons. Struggling to choose the right one for your need? Not to worry, this post will guide you through some of the available frameworks. RAD Studio Included Server Technologies : RAD Studio Included Client Technologies : Which includes REST Backend as a Service (BaaS) Client, Cloud Client libraries, REST Client libraries, SOAP Clients. 3rd Party Web Frameworks: Client Focused: Pascal->JavaScript Transpilers. Write in Object Pascal and translate/Compiles into JavaScript. Creates a pure Web client Solution. Compatible with many popular server solutions. Full Stack or Client/Server Focused: Framework covers the Server app and client interface. Balanced Approach good to choose when Both Server and Visually designed UI is one project. WebBroker is the core of the server for most frameworks listed below. Server Focused Open Source:

Read More

How To Migrate Your Legacy C++ Applications To The Latest Blazing-Fast Version

Thinking to migrate your Legacy C++Builder Applications to the Latest Delphi? Curious to know the things to do and tips to do effortless migrations? This post will guide you through the considerations for successful migrations Things to consider : Unicode Compatibility – Unicode support was added to RAD Studio, Delphi and C++Builder starting with the 2009 version. Many migration resources were developed at that time but are still useful today if upgrading from a pre-Unicode (2007 or earlier) version. Unicode Statistics Tool on your Delphi application and check if any Unicode changes are needed.This Unicode Statistics Tool will assist you in collecting useful statistics for the time and effort needed to migrate your Delphi applications to Unicode. More Resources for Unicode. 64 bit Migration -Ever since Delphi XE2, it has been possible to generate Delphi 64bit applications from the same code base as your traditional Windows 32bit Delphi code. The business case for 64-bit for business is covered in this tech paper The Impact of 64-bit Applications to your Company’s Bottom Line Database and Middleware -The Borland Database Engine (BDE) has been deprecated, and beginning with version XE8 the BDE has been removed from the Delphi installation, but is still available as a separate download from Code Central. All applications using the BDE are recommended to be migrated to FireDAC. If you are new to FireDAC Data Access Components, start here and look at the First Steps and Getting Started links. 3rd party Components : The 3rd party plug-ins (libraries) need to be rebuilt in the current Delphi version. Having the source code makes this easier. You will need to re-compile your 3rd party components / libraries from older Delphi using the current Delphi 10.4.1 version so the components and libraries can be used in current Delphi projects.Check this link for some of the third party components available with RAD Studio and you can search all tools and components on the Embarcadero Technology Partner Directory. Tips for successful migrations : Before Migration: Set an Objective like Why do we need to migrate? What do you want to Mograte to ? Verify availability of Third party applications. Look for Alternatives in GetIt/GitHub/Others. Will help to validate post migrations. BuildTime: Verify Project options , Compiler Version directives, Solve dependencies and your own code, Solve Hints and Warnings. Stabilization: Verify to stabilization by doing some functional tests, corrections of errors, acceptance test Modernization: Look out the modern features which latest version supports such as Use of Styles, Windows/High DPI themes. Use of panels Card,Grid,Stack,Flow. Migration from Client/server to Multi layered Application, Web frameworks, Multiplatform application. Look out the Latest Version Feature Matrix here. Watch the YouTube Video on Migration with Demonstration Webinar Replay for Delphi here. Watch the webinar on Migrating and Modernizing Legacy C++ Applications here.

Read More

OAuth2.0 With The Rest Client Components For C++ Builder

Authentication becomes a critical part of any business, that too developing applications using the OAuth2.0 protocol is still challenging to some C++Builder developers using Restful APIs as most modern IoT applications mandates. Don’t worry, this post will simplify your challenge and understand better. Assume an end-user(Resource Owner) has an account in google(Resource Server) and has resources like contacts. The same user wants to sign up in Facebook (Third-Party App), as a user, he needs to reuse users credentials of google in Facebook and avoid fresh signup(filling all the personal details in Facebook and creating login credentials orto access some of the protected resources from google e.g) use contacts from google to invite friends that need to be used on Facebook. This is achieved by traditional Client Server authentication. But this approach has drawbacks as mentioned below. End user credentials is used by 3rd party app. 3rd party app store credentials for later use. Resource servers must provide password authentication. End users cannot revoke access to individual 3rd party app as credential are universal, can only block access by changing password. Compromise of 3rd party app exposes end user password. OAuth2.0 addresses these issues by introducing an authorization layer and separating the role of the client from that of the resource owner. Instead of using the resource owner’s credentials to access protected resources, the client obtains an access token — a string denoting a specific scope, lifetime, and other access attributes. Access tokens are issued to third-party clients by an authorization server with the approval of the resource owner. The client uses the access token to access the protected resources hosted by the resource server. For above scenario, an end-user (resource owner) can grant facebook (client- webapp, browser, desktop app) access to his protected contacts stored at a google contacts (resource server), without sharing his username and password with the facebook client to invite friends. Instead, he authenticates directly with a server trusted by the contact service(authorization server), which issues the contacts service delegation-specific credentials (access token). End user data is exposed over a Restful API. All transaction is over HTTP/HTTPS. REST – Representational state transfer web services are known as Restful APIs is an architecture style not a protocol. It exposes end user data (XML or typically JSON) by creating URI and transfer over a HTTP protocol. For RestDemo Sample click here. OAuth2.0 Work Flow. Authorization Grant Types: It can be Authorization code, Implicit, Resource owner credentials, Client Credentials. OAuth2.0 and the Internet Of Things: IoT Gadgets and Devices vast of amount of data which can be Applied with analytics which can creates revenue stream. Many IoT Vendors expose end user data over Restful services. Be aware of Vendor Restful API restrictions such as Rate limiting, time and changes in vendor API may result in feature breaking in your client Application. To avoid such limitations you can check Embercadero’s Enterprise Mobility Services Middleware. Okay, this would have helped in understanding the concepts about OAuth2.0 and IoT Use cases. To check the demonstration in action checkout this below one.

Read More

30+ Delphi Units For The Next Level DevOps

GpDelphiUnits is a collection of Delphi units by Primož Gabrijelčič. These Delphi Units might help you to do some work quickly and efficiently. This is an open-source project and you can check out the full source code on over GitHub. What you can get from these units? Here are some of the available units with aims: DSiWin32 Collection of Win32/Win64 wrappers and helper functions. GpCommandLineParser Attribute-based command line parser. GpForm A simple form with some enhancements. GpHttp Asynchronous HTTP GET/POST with ICS and OmniThreadLibrary. GpHugeF Interface to 64-bit file functions with some added functionality. GpLists Various TList descendants, TList-compatible, and TList-similar classes. GpLockFreeQueue The sample implementation of a dynamically allocated, O(1) enqueue and dequeue, threadsafe, micro locking queue. GpManagedClass Smarter base class. Handles error codes, has a precondition and postcondition checker. GpStructuredStorage Structured storage (compound file; file system inside a file) implementation. GpStuff Various stuff with no other place to go. GpSync Enhanced synchronization primitives. GpSysHook The main unit for the GpSysHookDLL. Implements system-wide keyboard, mouse, shell, and CBT hooks. Supports multiple listeners, Delphi Units, automatic unhooking on process detach, and only installs the hooks that are needed. Supports notification listeners and filter listeners (should be used with care because SendMessage used for filtering can effectively block the whole system if the listener is not processing messages). Each listener can only listen to one hook because the hook code is sent as a message ID. All internal IDs are generated from the module name so you only have to rename the DLL to make it peacefully coexist with another GpSysHookDLL DLL. GpTextFile Interface to 8/16-bit text files and streams. Uses the GpHugeF unit for file access. GpTextStream Stream wrapper class that automatically converts another stream (containing text data) into a Unicode stream. The underlying stream can contain 8-bit text (in any codepage) or 16-bit text (in 16-bit or UTF8 encoding). GpTimezone Time zone conversion. GpVCL VCL helper library. GpVersion Version info accessors and modifiers, version storage, and formatting. SafeMem GetMem/FreeMem wrapper that checks for block overruns. SpinLock A scalable atomic lock Head over and check out the full project source code and documentation here!

Read More

Create a Web Application Security Blueprint

The best way to make web applications secure is to include security at every step along the development process, from requirements analysis, to design, to implementation and testing, and into maintenance and update phases. To that end, it’s wise to consider a kind of “Web Application Security Blueprint” as part and parcel of how you work through the application lifecycle. Here’s a checklist of items to consider and best practices to follow when putting such a blueprint together. Put the security focus on the web application with Web Application Security Blueprint First and foremost, this means scanning for and eliminating vulnerabilities before applications get released. Kiuwan’s code scanning tools and technologies can not only provide guidance and remediation for the code you build in house, but also assess risks and vulnerabilities in the open source frameworks and code libraries you reference in that code. Second, a constant focus on Web Application Security Blueprint means that security concerns play a role in establishing application architecture and design, and security reviews should be included as part of the feedback process in moving those choices and lifecycle steps forward. The same concerns apply when choosing open source or third-party components, libraries and frameworks. (Here again, Kiuwan can help provide insight on such things.) Third, it’s vital to choose development tools that include (or can incorporate) security scans as part of the process of managing builds, versions and releases. Kiuwan offers plug-ins for the following IDEs: Eclipse (Analyzer and Viewer) RAD (Rational Application Developer for WebSphere Software) IBM Rational Developer for i systems (and more) Microsoft Visual Studio (Viewer) JetBrains (Viewer) IntelliJ IDEA, PhpStorm, PyCharm (and more) Microsoft VS Code (Viewer) Use the right security tools Development managers and software architects would do well to consult security experts as well as developers in assembling an application security (AppSec) toolkit. This toolkit should include all the software and analysis tools required to identify and then address or remediate risks, threats and vulnerabilities. This is where Kiuwan’s code security tools really shine, including Code Security (SAST), Insights (SCA for assessing and managing open source risk) and Code Analysis (QA for code analysis, including IDE plug-ins). Assemble people with the proper skills and resources Developers need information and training about how best to consider and incorporate security concerns as a key ingredient throughout the entire development and operations lifecycles. To that end, Kiuwan offers a broad collection of on-demand webinars to help establish and elevate developers’ security consciousness and to foster a deeper understanding and more effective use of Kiuwan’s tools and technologies. Topics include tutorials on working with specific tools (code scanning, plug-in integration, working with open source components, and more), as well as training on continuous delivery (a stance often termed DevSecOps or even SecDevOps), managing security challenges on distributed teams, effective strategies for working on remote QA teams, and more. Kiuwan won’t leave you to figure out its tools and technologies on your own; you’ll find plenty of help, guidance, and examples. Pivot DevSecOps into the cloud Companies need to understand what kinds of security risks cloud providers pose (and most accept), as well as what kinds of security controls they use and offer to their customers to manage security in the cloud. When migrating applications from on-premises resources (compute, storage and networking) into the cloud (ditto), companies must develop a detailed plan to incorporate […]

Read More

Corona distance-tracking solution with Cisco Meraki and PRTG

Do you remember the summer of 2019, when we danced together at music festivals, populated beaches and went to the supermarket without being counted at the entrance? And all of this without a face mask? In 2020, many things have changed. Suddenly there is this fear of the virus, you pick up the word “Corona” in just about every conversation and much of the former easygoingness is suddenly gone. Companies are also thinking about what their everyday work life could look like in the future. The most important recommendation in office corridors at the moment is: Keep your distance! However, it is not always easy to assess this correctly. A team of the well-known IT company Bechtle GmbH in the Hannover office had the idea to find a solution for this within the framework of a virtual hackathon, which I will now introduce to you in more detail. The concept The objective of the idea was to create an analysis that would give the people in a room quick, easy and highly accurate information about whether the distances are appropriate. However, accuracy, complexity and speed are not easy to calculate here, which is why the result was not intended to be 100% accurate, but rather a flexible form of feedback that can be achieved without too much effort. Use of Meraki zones to determine distances Meraki cameras can determine the number of people in a camera image, and the image can also be divided into different, freely configurable zones. The idea is to set up the zones so that they correspond to the allowed distance. As soon as a zone is occupied by more than one person, this means that the distance is less than the required range. The information about the zones can be determined at Meraki via API or via MQTT stream. No upload of images to a cloud is necessary since the image evaluations are performed directly on the camera and only the purely numerical values are then transferred to the zones. Data analysis with PRTG Network Monitor To evaluate and display the mentioned numerical values, another tool is necessary. This is where PRTG Network Monitor comes into play. Using the REST Custom sensor, PRTG accesses the Meraki API and reads the necessary values. The first step is to display the people in each zone individually. Next, the Sensor Factory sensor in PRTG calculates the data and visualizes the results with a traffic light dashboard. This makes it visible at a glance if there are too many people in a zone and if the necessary distances are no longer given. That was only the beginning The proof of concept I just described was only the first step. Useful extensions are, for example, WiFi-capable lamps or traffic lights that directly signal that distances in a room can no longer be maintained by flashing a red light. Data transmission can also be optimized in the next step. Instead of the previous API-based solution, data transmission using the MQTT protocol is planned.

Read More

Powerful Human Interface Devices Library For C++ Builder

Communicating with Human Interface Devices such as Alphanumeric display, Bar Code Reader, Sensors, Volume control on Speakers/Headsets becomes a primary use case for real-world, Cross-platform applications. Do you spend more time in building libraries to communicate with Human Interface Devices for your Delphi/C++ FireMonkey applications? WINSOFT Provides a powerful library to get the job done. It uses the standard Windows HID API. Features: Able to notify on Human Interface Devices arrival and removal. Can retrieve all the HID devices information available in the System. Flexible to getting/set Feature Report for the HID devices. Works with Windows 32/64-bit applications. Versions Supported: /C++ Builder XE2 – C++ Builder 10.4.1 Sydney Platforms: Windows, OS X, Android, and iOS; Steps to Download and use the Native HID Library: Download Native HID for FireMonkey and Unzip the file. Nahttps://winsoft.sk/nathid.htmvigate to the Library folder for different Versions. e.g) Delphi104-Win32. Read the Readme.txt file to know about features and copyright information. Create a Windows VCL Application and use FHid.pas in the uses section. Include the Library folder into Project->Options->Delphi Compiler->Search Path. Compile and check for using the library. NativeHID Download and Use for FireMonkey demo:https://www.youtube.com/embed/qx5A1zm9WkM?feature=oembed Key HID concepts:Report -Reports are the actual data that is exchanged between a device and a software client.  Input Report – Data sent from the Human Interface Devices to the application, typically when the state of a control changes. Output Report – Data sent from the application to the HID device, for example to the LEDs on a keyboard. Feature Report -Data that can be manually read and/or written, and are typically related to configuration information. Report Descriptor – The Report Descriptor describes the format and meaning of the data that the device supports.UsageTables – Contain a list with descriptions of Usages, which describe the intended meaning and use of a particular item described in the Report Descriptor. For example, a Usage is defined for the left button of a mouse.  USB-IF WorkGroup Publishes the Usage Tables. See USB-IF HID Specifications. Learn how to build FireMonkey applications using Native HID library

Read More