
12. Using Yocto-RangeFinder with Visual
Basic .NET
VisualBasic has long been the most favored entrance path to the Microsoft world. Therefore, we had
to provide our library for this language, even if the new trend is shifting to C#. All the examples and
the project models are tested with Microsoft VisualBasic 2010 Express, freely available on the
Microsoft web site
1
.
12.1. Installation
Download the Visual Basic Yoctopuce library from the Yoctopuce web site
2
. There is no setup
program, simply copy the content of the zip file into the directory of your choice. You mostly need the
content of the
Sources
directory. The other directories contain the documentation and a few
sample programs. All sample projects are Visual Basic 2010, projects, if you are using a previous
version, you may have to recreate the projects structure from scratch.
12.2. Using the Yoctopuce API in a Visual Basic project
The Visual Basic.NET Yoctopuce library is composed of a DLL and of source files in Visual Basic.
The DLL is not a .NET DLL, but a classic DLL, written in C, which manages the low level
communications with the modules
3
. The source files in Visual Basic manage the high level part of the
API. Therefore, your need both this DLL and the .vb files of the
sources
directory to create a
project managing Yoctopuce modules.
Configuring a Visual Basic project
The following indications are provided for Visual Studio Express 2010, but the process is similar for
other versions. Start by creating your project. Then, on the
Solution Explorer
panel, right click on your
project, and select "Add" and then "Add an existing item".
A file selection window opens. Select the
yocto_api.vb
file and the files corresponding to the
functions of the Yoctopuce modules that your project is going to manage. If in doubt, select all the
files.
You then have the choice between simply adding these files to your project, or to add them as links
(the
Add
button is in fact a scroll-down menu). In the first case, Visual Studio copies the selected
1
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-basic-express
2
www.yoctopuce.com/EN/libraries.php
3
The sources of this DLL are available in the C++ API
www.yoctopuce.com
71
Содержание Yocto-RangeFinder
Страница 1: ...Yocto RangeFinder User s guide...
Страница 2: ......
Страница 18: ...12 www yoctopuce com...
Страница 26: ...20 www yoctopuce com...
Страница 42: ...36 www yoctopuce com...
Страница 70: ...gcc lyocto lm lpthread lusb 1 0 lstdc 10 Using Yocto RangeFinder with C 64 www yoctopuce com...
Страница 90: ...84 www yoctopuce com...
Страница 120: ...114 www yoctopuce com...
Страница 130: ...124 www yoctopuce com...
Страница 158: ...21 High level API Reference On failure throws an exception or returns a negative error code 152 www yoctopuce com...
Страница 484: ...478 www yoctopuce com...
Страница 488: ...482 www yoctopuce com...
Страница 490: ...23 Characteristics 484 www yoctopuce com...
Страница 491: ......
Страница 492: ......