Posts

Showing posts with the label PInteger

Delphi Data Types for API Integration

Sometime we may need to integrate APIs written on other languages into our Delphi application or we may need to call windows APIs when dealing with complex data structures or we may need to communicate with ActiveX OLE components. Then  in such cases, main issue is Data Type mismatch. So for better compatibility Delphi provides following Pointer data types which can be used to send and receive data to and from other application to Delphi applications. Integer Data Types Type Description Pointer Byte 8-bit unsigned integer PByte ShortInt 8-bit signed integer PShortInt Word 16-bit unsigned integer PWord SmallInt 16-bit signed integer PSmallInt Cardinal 32-bit unsigned integer PCardinal LongWord 32-bit unsigned integer 64-bit unsigned integer PLongWord Fixe...

Pointers In Delphi

Every data we use in an application is stored somewhere in the computer's memory. And a Pointer is a variable that stores a address of memory piece  where we store data, like in Delphi "a string is really just a pointer" or "an object is really just a pointer" or "event  handler such as OnClick is actually a pointer to a procedure". They allow direct access to memory, enabling complex data structures to be built and navigated. The advantages are: We can set that memory size as per our requirement In case of copy value of a variable from one to another we just need to change a pointer to point to a different address of memory which saved lots of time When we use Pointers The most common use for pointers in Delphi is when calling Windows APIs. Windows API functions use a number of data types that may be unfamiliar to the Delphi programmer. Most of the parameters in calling API functions are pointers to some data type.  Most of the t...