Archive for the ‘Blog Collections’ Category

Understanding Generic Types in Delphi

Generics, a powerful addition to Delphi, were introduced in Delphi 2009 as a new langage feature. Generics or generic types (also know as parametrized types), allow you to define classes that don’t specifically define the type of certain data members.
As an example, instead of using the TObjectList type to have a list of any object [...]

WiFi Networks and WiFi Adapters using the WMI and Delphi

The WMI provides several classes to retrieve information about the WiFi networks and  adapters, which these classes you will able to know for example the list available wifi networks, transmition and reception Wifi Stats, TCP/IP IPV4 and IPv6 settings and so on.
In order to work with the next WMI classes your Wifi Network adapter must [...]

Building a XE2 project group for a specific platform

Regularly someone asks how one can build a project group for a specific platform. The painfull way is to set each project by hand to the platform to build and then call “Build All” for the project group.
There are painless ways to switch the platform at once for all projects that support the platform.
Option #1:
Use [...]

A little bit about FireMonkey and Delphi XE2

FireMonkey is going to be a whole new world of possibilities for Delphi and C++Builder developers. The platform itself is flexible, customizable and multi-platform, all components behave the same on Windows and Mac. In this post I will give you a general idea of some very powerful concepts related with components in FireMonkey, during the [...]

Checking if a TCP port is Open using Delphi and Winsocks

Many times we need to know if a TCP port is open or not, here I leave a function to perform this task using winsoks.Code tested in Delphi 7, 2007 and 2010.

uses
  Winsock;

function PortTCP_IsOpen(dwPort : Word; ipAddressStr:AnsiString) : boolean;
var
  client : sockaddr_in;
  sock   : Integer;

  ret    : Integer;
  wsdata : WSAData;
begin
 Result:=False;
 ret := WSAStartup($0002, wsdata); //initiates [...]