JVCL Help:TJvHidDeviceController.CheckOutByCallback

From Project JEDI Wiki
Jump to navigationJump to search
JEDI Visual Component Library Help

Search in JVCL Help

 
Search in all projects
 

Summary

Write here a summary (1 line)


Pascal

 functionCheckOutByCallback(varHidDev: TJvHidDevice; Check: TJvHidCheckCallback): Boolean;


Parameters

Parameters Description
var HidDev: TJvHidDevice JvHidDevice-Object which matches the search criteria of the callback function.
Check: TJvHidCheckCallback Address of function which will be called by Windows to check the matching criteria.

Return Value

True: A HID device which matches the search criteria has been found and HidDev is valid.

False: No HID device found, HidDev is invalid.

Description

Checks out ("reserves") a hid-device which matches the given criteria. The criteria are defined by the programmer.

Example:


interface
  uses JvHidControllerClass;

TMyController = class(TObject)
  private
  HidController : TJvHidDeviceController; // HID-Controller-Object = interface to hardware
  HidDev        : TJvHidDevice;
  (...)

  public
  constructor Create(const IniFileName: string); // IOW-Controller-Objekt anlegen
  (...)
end;

var
  MyController: TMyController; // Controller-Object which does important tasks :-)

implementation

constructor TMyController.Create(const IniFileName: string);
  (...)
  HidController := TJvHidDeviceController.Create(nil);
  // define event function
  HidController.OnDeviceChange := HidControllerDeviceChange; // the event will automatically be activated
  (..)
end;

procedure TMyController.HidControllerDeviceChange(Sender: TObject);
  // Search for all HID-devices with 
end;

function FindMyDevice(AHidDev: TJvHidDevice): Boolean; stdcall;
begin
  Result := (AHidDev.Attributes.VendorID = MY_VENDOR_ID) and
   (AHidDev.Attributes.ProductID = MY_PRODUCT_ID) and
   (AHidDev.Caps.InputReportByteLength = 8);
end;

See Also

List here other properties, methods (comma seperated) Remove the 'See Also' section if there are no references


About

Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page