T3SP-D4MX Operator’s Manual
3.2.2 C
#
-Code
Interfacing the
cDMXU.dll
shared library from C
#
can be achieved by using
the
System.Runtime.InteropServices
service. An example class
definition for wrapping the library function is outlined below:
using System.Runtime.InteropServices;
namespace nsDMXU
{
public class cDMXU
{
// make sure the DLL can be found
const
string shared_lib = "cDMXU.dll";
const
CallingConvention ccv = CallingConvention.Cdecl;
[DllImport(shared_lib, CallingConvention = ccv)]
static extern int
cDMXU_Init(string id);
[DllImport(shared_lib, CallingConvention = ccv)]
static extern int
cDMXU_IsInitialized();
[DllImport(shared_lib, CallingConvention = ccv)]
static extern int
cDMXU_SetChannel(
int
channel);
[DllImport(shared_lib, CallingConvention = ccv)]
static extern int
cDMXU_GetChannel();
[DllImport(shared_lib, CallingConvention = ccv)]
static extern int
cDMXU_GetSerialNumber();
[DllImport(shared_lib, CallingConvention = ccv)]
static extern int
cDMXU_GetNumberOfChannels();
[DllImport(shared_lib, CallingConvention = ccv)]
static extern int
cDMXU_Release();
public
int
Init(string id) {
12
933407 Rev1