16. Using Yocto-Display with Delphi
Delphi is a descendent of Turbo-Pascal. Originally, Delphi was produced by Borland, Embarcadero
now edits it. The strength of this language resides in its ease of use, as anyone with some notions of
the Pascal language can develop a Windows application in next to no time. Its only disadvantage is
to cost something
1
.
Delphi libraries are provided not as VCL components, but directly as source files. These files are
compatible with most Delphi versions.
2
To keep them simple, all the examples provided in this documentation are console applications.
Obviously, the libraries work in a strictly identical way with VCL applications.
You will soon notice that the Delphi API defines many functions which return objects. You do not
need to deallocate these objects yourself, the API does it automatically at the end of the application.
16.1. Preparation
Go to the Yoctopuce web site and download the Yoctopuce Delphi libraries
3
. Uncompress everything
in a directory of your choice, add the subdirectory
sources
in the list of directories of Delphi libraries.
4
By default, the Yoctopuce Delphi library uses the
yapi.dll
DLL, all the applications you will create with
Delphi must have access to this DLL. The simplest way to ensure this is to make sure
yapi.dll
is
located in the same directory as the executable file of your application.
16.2. Control of the Display function
Launch your Delphi environment, copy the yapi.dll DLL in a directory, create a new console
application in the same directory, and copy-paste the piece of code below:
program
helloworld;
{$APPTYPE CONSOLE}
uses
SysUtils,
Windows,
yocto_api,
yocto_display;
1
Actually, Borland provided free versions (for personal use) of Delphi 2006 and 2007. Look for them on the Internet, you
may still be able to download them.
2
Delphi libraries are regularly tested with Delphi 5 and Delphi XE2.
3
www.yoctopuce.com/EN/libraries.php
4
Use the
Tools / Environment options
menu.
www.yoctopuce.com
95
Содержание Yocto-Display
Страница 1: ...Yocto Display User Manual...
Страница 2: ......
Страница 40: ...34 www yoctopuce com...
Страница 52: ...46 www yoctopuce com...
Страница 84: ...78 www yoctopuce com...
Страница 92: ...86 www yoctopuce com...
Страница 130: ...124 www yoctopuce com...
Страница 158: ...22 High level API Reference 152 www yoctopuce com On failure throws an exception or returns a negative error code...
Страница 422: ...416 www yoctopuce com...
Страница 424: ...24 Characteristics 418 www yoctopuce com...