#include "eyewin.h"
#include <stdio.h>
#include <stdarg.h>

/* redirect printf to Console */
// int printf(const char* format, ...)
_CRTIMP int __cdecl	printf (const char* format, ...)
{ va_list param;
  va_start(param, format);
  char buf[100];
  
  vsprintf(buf, format, param);
  return LCDPutString(buf);
}

HMODULE VWInitMHandle = GetModuleHandle ( NULL);
VWInitPointer VWInit = ( VWInitPointer ) GetProcAddress ( VWInitMHandle, "VWInit");

HMODULE VWReleaseMHandle = GetModuleHandle ( NULL);
VWReleasePointer VWRelease = ( VWReleasePointer ) GetProcAddress ( VWReleaseMHandle, "VWRelease");

HMODULE VWSetSpeedMHandle = GetModuleHandle ( NULL);
VWSetSpeedPointer VWSetSpeed = ( VWSetSpeedPointer ) GetProcAddress ( VWSetSpeedMHandle, "VWSetSpeed");

HMODULE VWGetSpeedMHandle = GetModuleHandle ( NULL);
VWGetSpeedPointer VWGetSpeed = ( VWGetSpeedPointer ) GetProcAddress ( VWGetSpeedMHandle, "VWGetSpeed");

HMODULE VWSetPositionMHandle = GetModuleHandle ( NULL);
VWSetPositionPointer VWSetPosition = ( VWSetPositionPointer ) GetProcAddress ( VWSetPositionMHandle, "VWSetPosition");

HMODULE VWGetPositionMHandle = GetModuleHandle ( NULL);
VWGetPositionPointer VWGetPosition = ( VWGetPositionPointer ) GetProcAddress ( VWGetPositionMHandle, "VWGetPosition");

HMODULE VWStartControlMHandle = GetModuleHandle ( NULL);
VWStartControlPointer VWStartControl = ( VWStartControlPointer ) GetProcAddress ( VWStartControlMHandle, "VWStartControl");

HMODULE VWStopControlMHandle = GetModuleHandle ( NULL);
VWStopControlPointer VWStopControl = ( VWStopControlPointer ) GetProcAddress ( VWStopControlMHandle, "VWStopControl");

HMODULE VWDriveStraightMHandle = GetModuleHandle ( NULL);
VWDriveStraightPointer VWDriveStraight = ( VWDriveStraightPointer ) GetProcAddress ( VWDriveStraightMHandle, "VWDriveStraight");

HMODULE VWDriveTurnMHandle = GetModuleHandle ( NULL);
VWDriveTurnPointer VWDriveTurn = ( VWDriveTurnPointer ) GetProcAddress ( VWDriveTurnMHandle, "VWDriveTurn");

HMODULE VWDriveCurveMHandle = GetModuleHandle ( NULL);
VWDriveCurvePointer VWDriveCurve = ( VWDriveCurvePointer ) GetProcAddress ( VWDriveCurveMHandle, "VWDriveCurve");

HMODULE VWDriveRemainMHandle = GetModuleHandle ( NULL);
VWDriveRemainPointer VWDriveRemain = ( VWDriveRemainPointer ) GetProcAddress ( VWDriveRemainMHandle, "VWDriveRemain");

HMODULE VWDriveDoneMHandle = GetModuleHandle ( NULL);
VWDriveDonePointer VWDriveDone = ( VWDriveDonePointer ) GetProcAddress ( VWDriveDoneMHandle, "VWDriveDone");

HMODULE VWDriveWaitMHandle = GetModuleHandle ( NULL);
VWDriveWaitPointer VWDriveWait = ( VWDriveWaitPointer ) GetProcAddress ( VWDriveWaitMHandle, "VWDriveWait");

HMODULE VWStalledMHandle = GetModuleHandle ( NULL);
VWStalledPointer VWStalled = ( VWStalledPointer ) GetProcAddress ( VWStalledMHandle, "VWStalled");

/* PSD ***************************************************************************************************/

HMODULE PSDInitMHandle = GetModuleHandle ( NULL);
PSDInitPointer PSDInit = ( PSDInitPointer ) GetProcAddress ( PSDInitMHandle, "PSDInit");

HMODULE PSDReleaseMHandle = GetModuleHandle ( NULL);
PSDReleasePointer PSDRelease = ( PSDReleasePointer ) GetProcAddress ( PSDReleaseMHandle, "PSDRelease");

HMODULE PSDStartMHandle = GetModuleHandle ( NULL);
PSDStartPointer PSDStart = ( PSDStartPointer ) GetProcAddress ( PSDStartMHandle, "PSDStart");

HMODULE PSDStopMHandle = GetModuleHandle ( NULL);
PSDStopPointer PSDStop = ( PSDStopPointer ) GetProcAddress ( PSDStopMHandle, "PSDStop");

HMODULE PSDCheckMHandle = GetModuleHandle ( NULL);
PSDCheckPointer PSDCheck = ( PSDCheckPointer ) GetProcAddress ( PSDCheckMHandle, "PSDCheck");

HMODULE PSDGetMHandle = GetModuleHandle ( NULL);
PSDGetPointer PSDGet = ( PSDGetPointer ) GetProcAddress ( PSDGetMHandle, "PSDGet");

HMODULE PSDGetRawMHandle = GetModuleHandle ( NULL);
PSDGetRawPointer PSDGetRaw = ( PSDGetRawPointer ) GetProcAddress ( PSDGetRawMHandle, "PSDGetRaw");

/* LCD ***************************************************************************************************/

HMODULE LCDPrintfMHandle = GetModuleHandle ( NULL);
LCDPrintfPointer LCDPrintf = ( LCDPrintfPointer ) GetProcAddress ( LCDPrintfMHandle, "LCDPrintf");

HMODULE LCDSetPrintfMHandle = GetModuleHandle ( NULL);
LCDSetPrintfPointer LCDSetPrintf = ( LCDSetPrintfPointer ) GetProcAddress ( LCDSetPrintfMHandle, "LCDSetPrintf");

HMODULE LCDClearMHandle = GetModuleHandle ( NULL);
LCDClearPointer LCDClear = ( LCDClearPointer ) GetProcAddress ( LCDClearMHandle, "LCDClear");

HMODULE LCDPutCharMHandle = GetModuleHandle ( NULL);
LCDPutCharPointer LCDPutChar = ( LCDPutCharPointer ) GetProcAddress ( LCDPutCharMHandle, "LCDPutChar");

HMODULE LCDSetCharMHandle = GetModuleHandle ( NULL);
LCDSetCharPointer LCDSetChar = ( LCDSetCharPointer ) GetProcAddress ( LCDSetCharMHandle, "LCDSetChar");

HMODULE LCDPutStringMHandle = GetModuleHandle ( NULL);
LCDPutStringPointer LCDPutString = ( LCDPutStringPointer ) GetProcAddress ( LCDPutStringMHandle, "LCDPutString");

HMODULE LCDSetStringMHandle = GetModuleHandle ( NULL);
LCDSetStringPointer LCDSetString = ( LCDSetStringPointer ) GetProcAddress ( LCDSetStringMHandle, "LCDSetString");

HMODULE LCDModeMHandle = GetModuleHandle ( NULL);
LCDModePointer LCDMode = ( LCDModePointer ) GetProcAddress ( LCDModeMHandle, "LCDMode");

HMODULE LCDGetPosMHandle = GetModuleHandle ( NULL);
LCDGetPosPointer LCDGetPos = ( LCDGetPosPointer ) GetProcAddress ( LCDGetPosMHandle, "LCDGetPos");

HMODULE LCDSetPosMHandle = GetModuleHandle ( NULL);
LCDSetPosPointer LCDSetPos = ( LCDSetPosPointer ) GetProcAddress ( LCDSetPosMHandle, "LCDSetPos");

HMODULE LCDPutColorGraphicMHandle = GetModuleHandle ( NULL);
LCDPutColorGraphicPointer LCDPutColorGraphic = ( LCDPutColorGraphicPointer ) GetProcAddress ( LCDPutColorGraphicMHandle, "LCDPutColorGraphic");

HMODULE LCDPutGraphicMHandle = GetModuleHandle ( NULL);
LCDPutGraphicPointer LCDPutGraphic = ( LCDPutGraphicPointer ) GetProcAddress ( LCDPutGraphicMHandle, "LCDPutGraphic");

HMODULE LCDPutImageMHandle = GetModuleHandle ( NULL);
LCDPutImagePointer LCDPutImage = ( LCDPutImagePointer ) GetProcAddress ( LCDPutImageMHandle, "LCDPutImage");

HMODULE LCDMenuMHandle = GetModuleHandle ( NULL);
LCDMenuPointer LCDMenu = ( LCDMenuPointer ) GetProcAddress ( LCDMenuMHandle, "LCDMenu");

HMODULE LCDMenuIMHandle = GetModuleHandle ( NULL);
LCDMenuIPointer LCDMenuI = ( LCDMenuIPointer ) GetProcAddress ( LCDMenuIMHandle, "LCDMenuI");

HMODULE LCDSetPixelMHandle = GetModuleHandle ( NULL);
LCDSetPixelPointer LCDSetPixel = ( LCDSetPixelPointer ) GetProcAddress ( LCDSetPixelMHandle, "LCDSetPixel");

HMODULE LCDInvertPixelMHandle = GetModuleHandle ( NULL);
LCDInvertPixelPointer LCDInvertPixel = ( LCDInvertPixelPointer ) GetProcAddress ( LCDInvertPixelMHandle, "LCDInvertPixel");

HMODULE LCDGetPixelMHandle = GetModuleHandle ( NULL);
LCDGetPixelPointer LCDGetPixel = ( LCDGetPixelPointer ) GetProcAddress ( LCDGetPixelMHandle, "LCDGetPixel");

HMODULE LCDLineMHandle = GetModuleHandle ( NULL);
LCDLinePointer LCDLine = ( LCDLinePointer ) GetProcAddress ( LCDLineMHandle, "LCDLine");

HMODULE LCDAreaMHandle = GetModuleHandle ( NULL);
LCDAreaPointer LCDArea = ( LCDAreaPointer ) GetProcAddress ( LCDAreaMHandle, "LCDArea");

/* simple functions added, calling LCDPrintf, TB, Jan. 2005 */

int LCDPutFloat (float f)
{ return LCDPrintf("%f",f); }

int LCDPutFloatS (float f, int minsp, int decimals)
{ char fmt[10] = "%0.0f"; minsp %= 10; decimals %= 10; 
  fmt[1] += minsp%10;    /* max 9 spaces */
  fmt[3] += decimals%10; /* max 9 spaces */
  return LCDPrintf(fmt,f); }

int LCDPutHex (int val)
{ return LCDPrintf("%8X",val); }

int LCDPutHex1 (int val)
{ return LCDPrintf("%2X",val&0xFF); }

int LCDPutInt (int val)
{ return LCDPrintf("%d",val); }

int LCDPutIntS (int val, int spaces)
{ char fmt[10] = "%0d"; 
  fmt[1] += spaces%10;  /* max 9 spaces */
  return LCDPrintf(fmt,val); }

/* KEY ***************************************************************************************************/

HMODULE KEYGetBufferMHandle = GetModuleHandle ( NULL);
KEYGetBufferPointer KEYGetBuffer = ( KEYGetBufferPointer ) GetProcAddress ( KEYGetBufferMHandle, "KEYGetBuffer");

HMODULE KEYGetMHandle = GetModuleHandle ( NULL);
KEYGetPointer KEYGet = ( KEYGetPointer ) GetProcAddress ( KEYGetMHandle, "KEYGet");

HMODULE KEYReadMHandle = GetModuleHandle ( NULL);
KEYReadPointer KEYRead = ( KEYReadPointer ) GetProcAddress ( KEYReadMHandle, "KEYRead");

HMODULE KEYWaitMHandle = GetModuleHandle ( NULL);
KEYWaitPointer KEYWait = ( KEYWaitPointer ) GetProcAddress ( KEYWaitMHandle, "KEYWait");

/* OS/Multi-Threading *************************************************************************************/

HMODULE OSMTInitMHandle = GetModuleHandle ( NULL);
OSMTInitPointer OSMTInit = ( OSMTInitPointer ) GetProcAddress ( OSMTInitMHandle, "OSMTInit");

HMODULE OSMTStatusMHandle = GetModuleHandle ( NULL);
OSMTStatusPointer OSMTStatus = ( OSMTStatusPointer ) GetProcAddress ( OSMTStatusMHandle, "OSMTStatus");

HMODULE OSSpawnMHandle = GetModuleHandle ( NULL);
OSSpawnPointer OSSpawn = ( OSSpawnPointer ) GetProcAddress ( OSSpawnMHandle, "OSSpawn");

HMODULE OSReadyMHandle = GetModuleHandle ( NULL);
OSReadyPointer OSReady = ( OSReadyPointer ) GetProcAddress ( OSReadyMHandle, "OSReady");

HMODULE OSSuspendMHandle = GetModuleHandle ( NULL);
OSSuspendPointer OSSuspend = ( OSSuspendPointer ) GetProcAddress ( OSSuspendMHandle, "OSSuspend");

HMODULE OSRescheduleMHandle = GetModuleHandle ( NULL);
OSReschedulePointer OSReschedule = ( OSReschedulePointer ) GetProcAddress ( OSRescheduleMHandle, "OSReschedule");

HMODULE OSYieldMHandle = GetModuleHandle ( NULL);
OSYieldPointer OSYield = ( OSYieldPointer ) GetProcAddress ( OSYieldMHandle, "OSYield");

HMODULE OSRunMHandle = GetModuleHandle ( NULL);
OSRunPointer OSRun = ( OSRunPointer ) GetProcAddress ( OSRunMHandle, "OSRun");

HMODULE OSGetUIDMHandle = GetModuleHandle ( NULL);
OSGetUIDPointer OSGetUID = ( OSGetUIDPointer ) GetProcAddress ( OSGetUIDMHandle, "OSGetUID");

HMODULE OSKillMHandle = GetModuleHandle ( NULL);
OSKillPointer OSKill = ( OSKillPointer ) GetProcAddress ( OSKillMHandle, "OSKill");

HMODULE OSExitMHandle = GetModuleHandle ( NULL);
OSExitPointer OSExit = ( OSExitPointer ) GetProcAddress ( OSExitMHandle, "OSExit");

HMODULE OSPanicMHandle = GetModuleHandle ( NULL);
OSPanicPointer OSPanic = ( OSPanicPointer ) GetProcAddress ( OSPanicMHandle, "OSPanic");

HMODULE OSSleepMHandle = GetModuleHandle ( NULL);
OSSleepPointer OSSleep = ( OSSleepPointer ) GetProcAddress ( OSSleepMHandle, "OSSleep");

HMODULE OSForbidMHandle = GetModuleHandle ( NULL);
OSForbidPointer OSForbid = ( OSForbidPointer ) GetProcAddress ( OSForbidMHandle, "OSForbid");

HMODULE OSPermitMHandle = GetModuleHandle ( NULL);
OSPermitPointer OSPermit = ( OSPermitPointer ) GetProcAddress ( OSPermitMHandle, "OSPermit");

HMODULE OSSemInitMHandle = GetModuleHandle ( NULL);
OSSemInitPointer OSSemInit = ( OSSemInitPointer ) GetProcAddress ( OSSemInitMHandle, "OSSemInit");

HMODULE OSSemPMHandle = GetModuleHandle ( NULL);
OSSemPPointer OSSemP = ( OSSemPPointer ) GetProcAddress ( OSSemPMHandle, "OSSemP");

HMODULE OSSemVMHandle = GetModuleHandle ( NULL);
OSSemVPointer OSSemV = ( OSSemVPointer ) GetProcAddress ( OSSemVMHandle, "OSSemV");

HMODULE OSSetTimeMHandle = GetModuleHandle ( NULL);
OSSetTimePointer OSSetTime = ( OSSetTimePointer ) GetProcAddress ( OSSetTimeMHandle, "OSSetTime");

HMODULE OSGetTimeMHandle = GetModuleHandle ( NULL);
OSGetTimePointer OSGetTime = ( OSGetTimePointer ) GetProcAddress ( OSGetTimeMHandle, "OSGetTime");

HMODULE OSShowTimeMHandle = GetModuleHandle ( NULL);
OSShowTimePointer OSShowTime = ( OSShowTimePointer ) GetProcAddress ( OSShowTimeMHandle, "OSShowTime");

HMODULE OSGetCountMHandle = GetModuleHandle ( NULL);
OSGetCountPointer OSGetCount = ( OSGetCountPointer ) GetProcAddress ( OSGetCountMHandle, "OSGetCount");

HMODULE OSWaitMHandle = GetModuleHandle ( NULL);
OSWaitPointer OSWait = ( OSWaitPointer ) GetProcAddress ( OSWaitMHandle, "OSWait");

HMODULE OSAttachTimerMHandle = GetModuleHandle ( NULL);
OSAttachTimerPointer OSAttachTimer = ( OSAttachTimerPointer ) GetProcAddress ( OSAttachTimerMHandle, "OSAttachTimer");

HMODULE OSDetachTimerMHandle = GetModuleHandle ( NULL);
OSDetachTimerPointer OSDetachTimer = ( OSDetachTimerPointer ) GetProcAddress ( OSDetachTimerMHandle, "OSDetachTimer");

HMODULE OSErrorMHandle = GetModuleHandle ( NULL);
OSErrorPointer OSError = ( OSErrorPointer ) GetProcAddress ( OSErrorMHandle, "OSError");

HMODULE OSMachineTypeMHandle = GetModuleHandle ( NULL);
OSMachineTypePointer OSMachineType = ( OSMachineTypePointer ) GetProcAddress ( OSMachineTypeMHandle, "OSMachineType");

HMODULE OSMachineIDMHandle = GetModuleHandle ( NULL);
OSMachineIDPointer OSMachineID = ( OSMachineIDPointer ) GetProcAddress ( OSMachineIDMHandle, "OSMachineID");

HMODULE OSMachineNameMHandle = GetModuleHandle ( NULL);
OSMachineNamePointer OSMachineName = ( OSMachineNamePointer ) GetProcAddress ( OSMachineNameMHandle, "OSMachineName");

HMODULE OSMachineSpeedMHandle = GetModuleHandle ( NULL);
OSMachineSpeedPointer OSMachineSpeed = ( OSMachineSpeedPointer ) GetProcAddress ( OSMachineSpeedMHandle, "OSMachineSpeed");

HMODULE OSVersionMHandle = GetModuleHandle ( NULL);
OSVersionPointer OSVersion = ( OSVersionPointer ) GetProcAddress ( OSVersionMHandle, "OSVersion");

/* RADIO ***************************************************************************************************/

HMODULE RADIOInitMHandle = GetModuleHandle ( NULL);
RADIOInitPointer RADIOInit = ( RADIOInitPointer ) GetProcAddress ( RADIOInitMHandle, "RADIOInit");

HMODULE RADIOTermMHandle = GetModuleHandle ( NULL);
RADIOTermPointer RADIOTerm = ( RADIOTermPointer ) GetProcAddress ( RADIOTermMHandle, "RADIOTerm");

HMODULE RADIOCheckMHandle = GetModuleHandle ( NULL);
RADIOCheckPointer RADIOCheck = ( RADIOCheckPointer ) GetProcAddress ( RADIOCheckMHandle, "RADIOCheck");

HMODULE RADIORecvMHandle = GetModuleHandle ( NULL);
RADIORecvPointer RADIORecv = ( RADIORecvPointer ) GetProcAddress ( RADIORecvMHandle, "RADIORecv");

HMODULE RADIOSendMHandle = GetModuleHandle ( NULL);
RADIOSendPointer RADIOSend = ( RADIOSendPointer ) GetProcAddress ( RADIOSendMHandle, "RADIOSend");

HMODULE RADIOSetIoct1MHandle = GetModuleHandle ( NULL);
RADIOSetIoct1Pointer RADIOSetIoct1 = ( RADIOSetIoct1Pointer ) GetProcAddress ( RADIOSetIoct1MHandle, "RADIOSetIoct1");

HMODULE RADIOGetIoct1MHandle = GetModuleHandle ( NULL);
RADIOGetIoct1Pointer RADIOGetIoct1 = ( RADIOGetIoct1Pointer ) GetProcAddress ( RADIOGetIoct1MHandle, "RADIOGetIoct1");

HMODULE RADIOGetStatusMHandle = GetModuleHandle ( NULL);
RADIOGetStatusPointer RADIOGetStatus = ( RADIOGetStatusPointer ) GetProcAddress ( RADIOGetStatusMHandle, "RADIOGetStatus");

/* CAM ***************************************************************************************************/

HMODULE CAMInitMHandle = GetModuleHandle ( NULL);
CAMInitPointer CAMInit = ( CAMInitPointer ) GetProcAddress ( CAMInitMHandle, "CAMInit");

HMODULE CAMReleaseMHandle = GetModuleHandle ( NULL);
CAMReleasePointer CAMRelease = ( CAMReleasePointer ) GetProcAddress ( CAMReleaseMHandle, "CAMRelease");

HMODULE CAMGetFrameMHandle = GetModuleHandle ( NULL);
CAMGetFramePointer CAMGetFrame = ( CAMGetFramePointer ) GetProcAddress ( CAMGetFrameMHandle, "CAMGetFrame");

HMODULE CAMGetColFrameMHandle = GetModuleHandle ( NULL);
CAMGetColFramePointer CAMGetColFrame = ( CAMGetColFramePointer ) GetProcAddress ( CAMGetColFrameMHandle, "CAMGetColFrame");

HMODULE CAMSetMHandle = GetModuleHandle ( NULL);
CAMSetPointer CAMSet = ( CAMSetPointer ) GetProcAddress ( CAMSetMHandle, "CAMSet");

HMODULE CAMGetMHandle = GetModuleHandle ( NULL);
CAMGetPointer CAMGet = ( CAMGetPointer ) GetProcAddress ( CAMGetMHandle, "CAMGet");

HMODULE CAMModeMHandle = GetModuleHandle ( NULL);
CAMModePointer CAMMode = ( CAMModePointer ) GetProcAddress ( CAMModeMHandle, "CAMMode");

/* IP ***************************************************************************************************/

HMODULE IPLaplaceMHandle = GetModuleHandle ( NULL);
IPLaplacePointer IPLaplace = ( IPLaplacePointer ) GetProcAddress ( IPLaplaceMHandle, "IPLaplace");

HMODULE IPSobelMHandle = GetModuleHandle ( NULL);
IPSobelPointer IPSobel = ( IPSobelPointer ) GetProcAddress ( IPSobelMHandle, "IPSobel");

HMODULE IPDitherMHandle = GetModuleHandle ( NULL);
IPDitherPointer IPDither = ( IPDitherPointer ) GetProcAddress ( IPDitherMHandle, "IPDither");

HMODULE IPDifferMHandle = GetModuleHandle ( NULL);
IPDifferPointer IPDiffer = ( IPDifferPointer ) GetProcAddress ( IPDifferMHandle, "IPDiffer");

HMODULE IPColor2GreyMHandle = GetModuleHandle ( NULL);
IPColor2GreyPointer IPColor2Grey = ( IPColor2GreyPointer ) GetProcAddress ( IPColor2GreyMHandle, "IPColor2Grey");

/* RS232 ***************************************************************************************************/

HMODULE OSCheckInRS232MHandle = GetModuleHandle ( NULL);
OSCheckInRS232Pointer OSCheckInRS232 = ( OSCheckInRS232Pointer ) GetProcAddress ( OSCheckInRS232MHandle, "OSCheckInRS232");

HMODULE OSCheckOutRS232MHandle = GetModuleHandle ( NULL);
OSCheckOutRS232Pointer OSCheckOutRS232 = ( OSCheckOutRS232Pointer ) GetProcAddress ( OSCheckOutRS232MHandle, "OSCheckOutRS232");

HMODULE OSFlushInRS232MHandle = GetModuleHandle ( NULL);
OSFlushInRS232Pointer OSFlushInRS232 = ( OSFlushInRS232Pointer ) GetProcAddress ( OSFlushInRS232MHandle, "OSFlushInRS232");

HMODULE OSFlushOutRS232Handle = GetModuleHandle ( NULL);
OSFlushOutRS232Pointer OSFlushOutRS232 = ( OSFlushOutRS232Pointer ) GetProcAddress ( OSFlushOutRS232Handle, "OSFlushOutRS232");

HMODULE OSInitRS232MHandle = GetModuleHandle ( NULL);
OSInitRS232Pointer OSInitRS232 = ( OSInitRS232Pointer ) GetProcAddress ( OSInitRS232MHandle, "OSInitRS232");

HMODULE OSRecvRS232MHandle = GetModuleHandle ( NULL);
OSRecvRS232Pointer OSRecvRS232 = ( OSRecvRS232Pointer ) GetProcAddress ( OSRecvRS232MHandle, "OSRecvRS232");

HMODULE OSSendCharRS232MHandle = GetModuleHandle ( NULL);
OSSendCharRS232Pointer OSSendCharRS232 = ( OSSendCharRS232Pointer ) GetProcAddress ( OSSendCharRS232MHandle, "OSSendCharRS232");

HMODULE OSSendRS232MHandle = GetModuleHandle ( NULL);
OSSendRS232Pointer OSSendRS232 = ( OSSendRS232Pointer ) GetProcAddress ( OSSendRS232MHandle, "OSSendRS232");

/**********************************************************************************************************/

HMODULE OSEnableMHandle = GetModuleHandle ( NULL);
OSEnablePointer OSEnable = ( OSEnablePointer ) GetProcAddress ( OSEnableMHandle, "OSEnable");

HMODULE OSDisableMHandle = GetModuleHandle ( NULL);
OSDisablePointer OSDisable = ( OSDisablePointer ) GetProcAddress ( OSDisableMHandle, "OSDisable");

HMODULE OSGetVarMHandle = GetModuleHandle ( NULL);
OSGetVarPointer OSGetVar = ( OSGetVarPointer ) GetProcAddress ( OSGetVarMHandle, "OSGetVar");

HMODULE OSPutVarMHandle = GetModuleHandle ( NULL);
OSPutVarPointer OSPutVar = ( OSPutVarPointer ) GetProcAddress ( OSPutVarMHandle, "OSPutVar");

HMODULE OSDownloadMHandle = GetModuleHandle ( NULL);
OSDownloadPointer OSDownload = ( OSDownloadPointer ) GetProcAddress ( OSDownloadMHandle, "OSDownload");

HMODULE AUPlaySampleMHandle = GetModuleHandle ( NULL);
AUPlaySamplePointer AUPlaySample = ( AUPlaySamplePointer ) GetProcAddress ( AUPlaySampleMHandle, "AUPlaySample");

HMODULE AUCheckSampleMHandle = GetModuleHandle ( NULL);
AUCheckSamplePointer AUCheckSample = ( AUCheckSamplePointer ) GetProcAddress ( AUCheckSampleMHandle, "AUCheckSample");

HMODULE AURecordSampleMHandle = GetModuleHandle ( NULL);
AURecordSamplePointer AURecordSample = ( AURecordSamplePointer ) GetProcAddress ( AURecordSampleMHandle, "AURecordSample");

HMODULE AUCheckRecordMHandle = GetModuleHandle ( NULL);
AUCheckRecordPointer AUCheckRecord = ( AUCheckRecordPointer ) GetProcAddress ( AUCheckRecordMHandle, "AUCheckRecord");

HMODULE AUToneMHandle = GetModuleHandle ( NULL);
AUTonePointer AUTone = ( AUTonePointer ) GetProcAddress ( AUToneMHandle, "AUTone");

HMODULE AUBeepMHandle = GetModuleHandle ( NULL);
AUBeepPointer AUBeep = ( AUBeepPointer ) GetProcAddress ( AUBeepMHandle, "AUBeep");

HMODULE AUCaptureMicMHandle = GetModuleHandle ( NULL);
AUCaptureMicPointer AUCaptureMic = ( AUCaptureMicPointer ) GetProcAddress ( AUCaptureMicMHandle, "AUCaptureMic");

HMODULE AUCheckToneMHandle = GetModuleHandle ( NULL);
AUCheckTonePointer AUCheckTone = ( AUCheckTonePointer ) GetProcAddress ( AUCheckToneMHandle, "AUCheckTone");

HMODULE SERVOInitMHandle = GetModuleHandle ( NULL);
SERVOInitPointer SERVOInit = ( SERVOInitPointer ) GetProcAddress ( SERVOInitMHandle, "SERVOInit");

HMODULE SERVOReleaseMHandle = GetModuleHandle ( NULL);
SERVOReleasePointer SERVORelease = ( SERVOReleasePointer ) GetProcAddress ( SERVOReleaseMHandle, "SERVORelease");

HMODULE SERVOSetMHandle = GetModuleHandle ( NULL);
SERVOSetPointer SERVOSet = ( SERVOSetPointer ) GetProcAddress ( SERVOSetMHandle, "SERVOSet");

HMODULE MOTORInitMHandle = GetModuleHandle ( NULL);
MOTORInitPointer MOTORInit = ( MOTORInitPointer ) GetProcAddress ( MOTORInitMHandle, "MOTORInit");

HMODULE MOTORReleaseMHandle = GetModuleHandle ( NULL);
MOTORReleasePointer MOTORRelease = ( MOTORReleasePointer ) GetProcAddress ( MOTORReleaseMHandle, "MOTORRelease");

HMODULE MOTORDriveMHandle = GetModuleHandle ( NULL);
MOTORDrivePointer MOTORDrive = ( MOTORDrivePointer ) GetProcAddress ( MOTORDriveMHandle, "MOTORDrive");

HMODULE QUADInitMHandle = GetModuleHandle ( NULL);
QUADInitPointer QUADInit = ( QUADInitPointer ) GetProcAddress ( QUADInitMHandle, "QUADInit");

HMODULE QUADReleaseMHandle = GetModuleHandle ( NULL);
QUADReleasePointer QUADRelease = ( QUADReleasePointer ) GetProcAddress ( QUADReleaseMHandle, "QUADRelease");

HMODULE QUADResetMHandle = GetModuleHandle ( NULL);
QUADResetPointer QUADReset = ( QUADResetPointer ) GetProcAddress ( QUADResetMHandle, "QUADReset");

HMODULE QUADReadMHandle = GetModuleHandle ( NULL);
QUADReadPointer QUADRead = ( QUADReadPointer ) GetProcAddress ( QUADReadMHandle, "QUADRead");

HMODULE QUADGetMotorMHandle = GetModuleHandle ( NULL);
QUADGetMotorPointer QUADGetMotor = ( QUADGetMotorPointer ) GetProcAddress ( QUADGetMotorMHandle, "QUADGetMotor");

HMODULE QUADODOReadMHandle = GetModuleHandle ( NULL);
QUADODOReadPointer QUADODORead = ( QUADODOReadPointer ) GetProcAddress ( QUADODOReadMHandle, "QUADODORead");

HMODULE QUADODOResetMHandle = GetModuleHandle ( NULL);
QUADODOResetPointer QUADODOReset = ( QUADODOResetPointer ) GetProcAddress ( QUADODOResetMHandle, "QUADODOReset");

HMODULE BUMPInitMHandle = GetModuleHandle ( NULL);
BUMPInitPointer BUMPInit = ( BUMPInitPointer ) GetProcAddress ( BUMPInitMHandle, "BUMPInit");

HMODULE BUMPReleaseMHandle = GetModuleHandle ( NULL);
BUMPReleasePointer BUMPRelease = ( BUMPReleasePointer ) GetProcAddress ( BUMPReleaseMHandle, "BUMPRelease");

HMODULE BUMPCheckMHandle = GetModuleHandle ( NULL);
BUMPCheckPointer BUMPCheck = ( BUMPCheckPointer ) GetProcAddress ( BUMPCheckMHandle, "BUMPCheck");

HMODULE IRInitMHandle = GetModuleHandle ( NULL);
IRInitPointer IRInit = ( IRInitPointer ) GetProcAddress ( IRInitMHandle, "IRInit");

HMODULE IRReleaseMHandle = GetModuleHandle ( NULL);
IRReleasePointer IRRelease = ( IRReleasePointer ) GetProcAddress ( IRReleaseMHandle, "IRRelease");

HMODULE IRReadMHandle = GetModuleHandle ( NULL);
IRReadPointer IRRead = ( IRReadPointer ) GetProcAddress ( IRReadMHandle, "IRRead");

HMODULE OSReadInLatchMHandle = GetModuleHandle ( NULL);
OSReadInLatchPointer OSReadInLatch = ( OSReadInLatchPointer ) GetProcAddress ( OSReadInLatchMHandle, "OSReadInLatch");

HMODULE OSWriteOutLatchMHandle = GetModuleHandle ( NULL);
OSWriteOutLatchPointer OSWriteOutLatch = ( OSWriteOutLatchPointer ) GetProcAddress ( OSWriteOutLatchMHandle, "OSWriteOutLatch");

HMODULE OSReadOutLatchMHandle = GetModuleHandle ( NULL);
OSReadOutLatchPointer OSReadOutLatch = ( OSReadOutLatchPointer ) GetProcAddress ( OSReadOutLatchMHandle, "OSReadOutLatch");

HMODULE OSReadParDataMHandle = GetModuleHandle ( NULL);
OSReadParDataPointer OSReadParData = ( OSReadParDataPointer ) GetProcAddress ( OSReadParDataMHandle, "OSReadParData");

HMODULE OSMHandle = GetModuleHandle ( NULL);
OSWriteParDataPointer OSWriteParData = ( OSWriteParDataPointer ) GetProcAddress ( OSMHandle, "OSWriteParData");

HMODULE OSReadParSRMHandle = GetModuleHandle ( NULL);
OSReadParSRPointer OSReadParSR = ( OSReadParSRPointer ) GetProcAddress ( OSReadParSRMHandle, "OSReadParSR");

HMODULE OSWriteParCTRLMHandle = GetModuleHandle ( NULL);
OSWriteParCTRLPointer OSWriteParCTRL = ( OSWriteParCTRLPointer ) GetProcAddress ( OSWriteParCTRLMHandle, "OSWriteParCTRL");

HMODULE OSReadParCTRLMHandle = GetModuleHandle ( NULL);
OSReadParCTRLPointer OSReadParCTRL = ( OSReadParCTRLPointer ) GetProcAddress ( OSReadParCTRLMHandle, "OSReadParCTRL");

HMODULE OSGetADMHandle = GetModuleHandle ( NULL);
OSGetADPointer OSGetAD = ( OSGetADPointer ) GetProcAddress ( OSGetADMHandle, "OSGetAD");

HMODULE OSOffADMHandle = GetModuleHandle ( NULL);
OSOffADPointer OSOffAD = ( OSOffADPointer ) GetProcAddress ( OSOffADMHandle, "OSOffAD");

HMODULE COMPASSCalibrateMHandle = GetModuleHandle ( NULL);
COMPASSCalibratePointer COMPASSCalibrate = ( COMPASSCalibratePointer ) GetProcAddress ( COMPASSCalibrateMHandle, "COMPASSCalibrate");

HMODULE COMPASSCheckMHandle = GetModuleHandle ( NULL);
COMPASSCheckPointer COMPASSCheck = ( COMPASSCheckPointer ) GetProcAddress ( COMPASSCheckMHandle, "COMPASSCheck");

HMODULE COMPASSGetMHandle = GetModuleHandle ( NULL);
COMPASSGetPointer COMPASSGet = ( COMPASSGetPointer ) GetProcAddress ( COMPASSGetMHandle, "COMPASSGet");

HMODULE COMPASSInitMHandle = GetModuleHandle ( NULL);
COMPASSInitPointer COMPASSInit = ( COMPASSInitPointer ) GetProcAddress ( COMPASSInitMHandle, "COMPASSInit");

HMODULE COMPASSReleaseMHandle = GetModuleHandle ( NULL);
COMPASSReleasePointer COMPASSRelease = ( COMPASSReleasePointer ) GetProcAddress ( COMPASSReleaseMHandle, "COMPASSRelease");

HMODULE COMPASSStartMHandle = GetModuleHandle ( NULL);
COMPASSStartPointer COMPASSStart = ( COMPASSStartPointer ) GetProcAddress ( COMPASSStartMHandle, "COMPASSStart");

HMODULE COMPASSStopMHandle = GetModuleHandle ( NULL);
COMPASSStopPointer COMPASSStop = ( COMPASSStopPointer ) GetProcAddress ( COMPASSStopMHandle, "COMPASSStop");

HMODULE SIMGetActualPosMHandle = GetModuleHandle ( NULL);
SIMGetActualPosPointer SIMGetActualPos = ( SIMGetActualPosPointer ) GetProcAddress ( SIMGetActualPosMHandle, "SIMGetActualPos");

HMODULE SIMGetActualPhiMHandle = GetModuleHandle ( NULL);
SIMGetActualPhiPointer SIMGetActualPhi = ( SIMGetActualPhiPointer ) GetProcAddress ( SIMGetActualPhiMHandle, "SIMGetActualPhi");

HMODULE SIMGetActualBallPosMHandle = GetModuleHandle ( NULL);
SIMGetActualBallPosPointer SIMGetActualBallPos = ( SIMGetActualBallPosPointer ) GetProcAddress ( SIMGetActualBallPosMHandle, "SIMGetActualBallPos");

HMODULE SIMSetBallPosMHandle = GetModuleHandle ( NULL);
SIMSetBallPosPointer SIMSetBallPos = ( SIMSetBallPosPointer ) GetProcAddress ( SIMSetBallPosMHandle, "SIMSetBallPos");

HMODULE SIMExitMHandle = GetModuleHandle ( NULL);
SIMExitPointer SIMExit = ( SIMExitPointer ) GetProcAddress ( SIMExitMHandle, "SIMExit");

HMODULE SIM_CAMSetPanTiltAngleMHandle = GetModuleHandle ( NULL);
SIM_CAMSetPanTiltAnglePointer SIM_CAMSetPanTiltAngle = ( SIM_CAMSetPanTiltAnglePointer ) GetProcAddress ( SIM_CAMSetPanTiltAngleMHandle, "SIM_CAMSetPanTiltAngle");

HMODULE SIM_SetKickerMHandle = GetModuleHandle ( NULL);
SIM_SetKickerPointer SIM_SetKicker = ( SIM_SetKickerPointer ) GetProcAddress ( SIM_SetKickerMHandle, "SIM_SetKicker");
