RTC
®
5 PC Interface Board
Rev. 1.9 e
6 Developing User Applications
63
C
In C, you can choose either implicit linking – also
known as static load or load-time dynamic linking –
or explicit linking – also known as dynamic load or
run-time dynamic linking.
Implicit Linking
To accomplishing implicit linking, include the header
file
RTC5impl.h
and link with the (C) import library
RTC5DLL.LIB
(for Win32-based applications or with
RTC5DLLx64.LIB
for Win64-based applications) for
building the executable.
Call the RTC
®
5 commands you need like
goto_xy(1000, 2500);
for causing a jump to location 1000, 2500.
Explicit Linking
To accomplishing explicit linking, include the header
file
RTC5expl.h
. Before calling any RTC
®
5 function,
initialize the DLL by calling the function
RTC5open
(which is defined in the file
RTC5expl.c
).
When you are finished using the RTC
®
5, close the DLL
by calling the function
RTC5close
(also defined in the
file
RTC5expl.c
).
For building the executable, link with the file
RTC5EXPL.OBJ
, which you can generate from the
source code
RTC5expl.c
.
Call the RTC
®
5 commands you need, like
goto_xy(1000, 2500);
for causing a jump to location 1000, 2500.
Pros and Cons of Implicit and Explicit Linking
C++
If you want to use references instead of pointers for
returning values to function parameters in C++ (for
instance
UINT&Pos
instead of
UINT*Pos
), use the files
RTC5impl.hpp
instead of
RTC5impl.h
. Otherwise the
command import is realized as in C (see above).
C#
To accomplishing implicit linking in C#, import decla-
rations of the wrapper class are provided.
As of DLL 537: The wrapper class also supports the
’Any CPU’ option for simultaneous usage with 32-bit
and 64-bit programs.
Implicit Linking Explicit Linking
Necessary
Files
RTC5impl.h
or
RTC5impl.hpp
,
RTC5DLL.LIB
or
RTC5DLLx64.LIB
RTC5expl.h
,
RTC5expl.c
Advantage Easiest linking
method
Eliminates the
need to link the
application with
an import library
Negative
Aspect
Need to link the
application with a
compiler-specific
import library
Need to initialize
(
RTC5open
) and
close (
RTC5close
)
the DLL