Posts

Showing posts from 2014

STRING / PCHAR / CHAR in Delphi

STRING / PCHAR / CHAR in Delphi --------------------------------------------- Char ------- Char is a data type that holds only one character as value. Ansi Characters are used to store single byte ansi characters. Unicode characters are used to store 2byte characters that is to cupport foreign languages like chinese, japanese etc. var    chr1 : Char;        // Holds a single character, alphabet    chr2 : WideChar;    // Holds a single character, International alphabet // for Unicode support    chr3 : AnsiChar;    // Holds a single character, alphabet NON-PRINTING OR CONTROL CHARACTERS, NOT USED IN THIS CLASS, INCLUDED FOR INTEREST ONLY   0 Null (nothing)  7 Bell  8 Back space  9 Tab 10 Line feed (new line at present column) 13 Carriage return (return to beginning of line) 26 End of file 27 [Esc] (Escape key) ASCII CHARACTER CODES 32 [space]   64 @          96 ` 33 !         65 A          97 a 34 "         66 B          98 b 35 #        67 C          99 c 36 $        68 D      

How to send Email in Delphi?

Today in most of software program it is required to send mail to others with attached data. As some time we need to update clients about their account details, status or any other information through mail. So Delphi provides so many easiest ways to send mail from our Delphi application. I have collected some of ways which are very useful for Delphi developers. In Delphi we don't required any third party components to send mails. We can send mail to single or group of peoples with CC, BCC and attachments. Even we can send HTML mails from Delphi. So here are the ways... 1. ShellExecute Sends Email using default mail client software installed on user's system. But it will not work with attachment for every mail client. And you have to use ShellAPI  unit in uses list. ShellExecute(Self.Handle,              nil,              'mailto:' +              'jiten.g.s001@gmail.com' +              '?Subject=Test Message Subject' +            

ShellExecute in Delphi

ShellExecute in Delphi – Launch external applications. ShellExecute is Delphi Windows API function that is mostly used for launch external applications from our Delphi application. This function is linked to the ShellExecute Windows  API function. The function returns an integer that corresponds to an error code which is very useful when we need to show some status  if the function worked  or not . By using ShellExecute we can also do following operations.... Can print documents from within my program, without explicitly starting the application  that created the document, such as: print a Word-document without starting Word. Can open browser with a local HTML page Can surf to a site i.e. open an external URL link from a Delphi application Can send mails thorugh outlook Syntax of Windows API function HINSTANCE ShellExecute(   _In_opt_        HWND hwnd,   _In_opt_        LPCTSTR lpOperation,   _In_              LPCTSTR lpFile,   _In_opt_        LPC

Windows Service Application in Delphi

Image
What is Windows Service? Windows service is an application that runs on background. It is usually used to check system updates continuously, to work on system resources. Service applications take requests from client applications, process those requests, and return information to the client applications. They typically run in the background, without much user input. Why do we need it? Suppose we have system that needs to respond 24/7 days or if we have software that needs to update frequently, then we can create service which will check the new updates and download it. Then update to new software. In such situations we can use Window Services. What are the limits? We cannot use any visual components in service applications. You can add just any nonvisual component to the new service. But you’re restricted to nonvisual components; you'll get an exception Controls Cannot Be Added To A Service message if you try to drop a visual component How to create Windows Serv