Attribute VB_Name = "wc116" ' declare entry points to WheelCommander DLL Declare Sub NdiCmd_Init Lib "NdiCmdC.dll" Alias "_NdiCmd_Init@0" () Declare Function NdiCmd_Search Lib "NdiCmdC.dll" Alias "_NdiCmd_Search@0" () As Long Declare Function NdiCmd_CheckPort Lib "NdiCmdC.dll" Alias "_NdiCmd_CheckPort@4" (ByVal port As Long) As Long Declare Function NdiCmd_GetFirstPort Lib "NdiCmdC.dll" Alias "_NdiCmd_GetFirstPort@0" () As Long Declare Function NdiCmd_GetNextPort Lib "NdiCmdC.dll" Alias "_NdiCmd_GetNextPort@4" (ByVal prev As Long) As Long Declare Sub NdiCmd_RunWizard Lib "NdiCmdC.dll" Alias "_NdiCmd_RunWizard@4" (ByVal wizMode As Long) Declare Function NdiCmd_GetWheelCommander Lib "NdiCmdC.dll" Alias "_NdiCmd_GetWheelCommander@0" () As Long Declare Function NdiCmd_Sync Lib "NdiCmdC.dll" Alias "_NdiCmd_Sync@4" (ByVal handle As Long) As Long Declare Function NdiCmd_GetName Lib "NdiCmdC.dll" Alias "_NdiCmd_GetName@12" (ByVal handle As Long, ByVal name As String, version As Long) As Long Declare Function NdiCmd_Coast Lib "NdiCmdC.dll" Alias "_NdiCmd_Coast@4" (ByVal handle As Long) As Long Declare Function NdiCmd_Brake Lib "NdiCmdC.dll" Alias "_NdiCmd_Brake@4" (ByVal handle As Long) As Long Declare Function NdiCmd_Reset Lib "NdiCmdC.dll" Alias "_NdiCmd_Reset@4" (ByVal handle As Long) As Long Declare Function NdiCmd_Go Lib "NdiCmdC.dll" Alias "_NdiCmd_Go@4" (ByVal handle As Long) As Long Declare Function NdiCmd_SetVelocity Lib "NdiCmdC.dll" Alias "_NdiCmd_SetVelocity@8" (ByVal handle As Long, ByVal vel As Long) As Long Declare Function NdiCmd_GetVelocity Lib "NdiCmdC.dll" Alias "_NdiCmd_GetVelocity@8" (ByVal handle As Long, vel As Long) As Long Declare Function NdiCmd_SetAccel Lib "NdiCmdC.dll" Alias "_NdiCmd_SetAcceleration@8" (ByVal handle As Long, ByVal vel As Long) As Long Declare Function NdiCmd_GetAccel Lib "NdiCmdC.dll" Alias "_NdiCmd_GetAcceleration@8" (ByVal handle As Long, vel As Long) As Long Declare Function NdiCmd_SetRotation Lib "NdiCmdC.dll" Alias "_NdiCmd_SetRotation@8" (ByVal handle As Long, ByVal vel As Long) As Long Declare Function NdiCmd_GetRotation Lib "NdiCmdC.dll" Alias "_NdiCmd_GetRotation@8" (ByVal handle As Long, vel As Long) As Long Declare Function NdiCmd_SetAngle Lib "NdiCmdC.dll" Alias "_NdiCmd_SetAngle@8" (ByVal handle As Long, ByVal vel As Long) As Long Declare Function NdiCmd_GetAngle Lib "NdiCmdC.dll" Alias "_NdiCmd_GetAngle@8" (ByVal handle As Long, vel As Long) As Long Declare Function NdiCmd_SetXAngle Lib "NdiCmdC.dll" Alias "_NdiCmd_SetXAngle@8" (ByVal handle As Long, ByVal vel As Long) As Long Declare Function NdiCmd_GetXAngle Lib "NdiCmdC.dll" Alias "_NdiCmd_GetXAngle@8" (ByVal handle As Long, vel As Long) As Long Declare Function NdiCmd_SetDist Lib "NdiCmdC.dll" Alias "_NdiCmd_SetDistance@8" (ByVal handle As Long, ByVal vel As Long) As Long Declare Function NdiCmd_GetDist Lib "NdiCmdC.dll" Alias "_NdiCmd_GetDistance@8" (ByVal handle As Long, vel As Long) As Long Declare Function NdiCmd_SetXDist Lib "NdiCmdC.dll" Alias "_NdiCmd_SetXDistance@8" (ByVal handle As Long, ByVal vel As Long) As Long Declare Function NdiCmd_GetXDist Lib "NdiCmdC.dll" Alias "_NdiCmd_GetXDistance@8" (ByVal handle As Long, vel As Long) As Long Declare Sub NdiCmd_CloseAllPorts Lib "NdiCmdC.dll" Alias "_NdiCmd_CloseAllPorts@0" () Public handle As Long ' handle to current WheelCommander Public Function Init_WheelCommander() As Long handle = -1 NdiCmd_Init ' init library If NdiCmd_Search <> 1 Then ' try finding WheelCommander NdiCmd_RunWizard 1 ' if it failed, run the wizard If NdiCmd_Search = 1 Then ' try finding it again handle = NdiCmd_GetWheelCommander ' if found, get a handle to the WheelCommander End If Else handle = NdiCmd_GetWheelCommander ' we found it straight away, so get a handle to it End If Init_WheelCommander = handle End Function