public FT_STATUS GetNumberOfDevices(ref UInt32 devcount)
{
// Initialise ftStatus to something other than FT_OK
FT_STATUS ftStatus = FT_STATUS.FT_OTHER_ERROR;
// If the DLL hasn't been loaded, just return here
if (hFTD2XXDLL == IntPtr.Zero)
return ftStatus;
// Check for our required function pointers being set up
if (pFT_CreateDeviceInfoList != IntPtr.Zero)
{
tFT_CreateDeviceInfoList FT_CreateDeviceInfoList = (tFT_CreateDeviceInfoList)Marshal.GetDelegateForFunctionPointer(pFT_CreateDeviceInfoList, typeof(tFT_CreateDeviceInfoList));
// Call FT_CreateDeviceInfoList
ftStatus = FT_CreateDeviceInfoList(ref devcount);
}
else
{
LogB.Debug("FTD2XX: Failed to load function FT_CreateDeviceInfoList.");
}
return ftStatus;
}