startCapture

Declaration

Delphi (DLL)

function startCapture(Certificate: ShortString; CheckPad, AutostartSearching, showConnectionWinIfAutostart, ReadAndSaveInRegistry: Boolean; var Padsettings: ShortString): Boolean;

C/C++ (DLL)

SOPAD_API BOOL SOPAD_startCapture(const char* szCertificate, BOOL bCheckPad, BOOL bAutostartSearching, BOOL bShowConnectionWinIfAutostart, BOOL bReadAndSaveInRegistry, char szPadSettings[SOPAD_MAX_STRING_LENGTH]);

ActiveX

HRESULT startCapture([in] BSTR Certificate, [in] VARIANT_BOOL CheckPad, [in] VARIANT_BOOL AutostartSerching, [in] VARIANT_BOOL showConnectionWinIfAutostart, [in] VARIANT_BOOL ReadAndSaveInRegistry, [in, out] BSTR* Padsettings, [out, retval] VARIANT_BOOL* Value);

Description

Startcapture replaces setPadSettings and startRead (Both functions are still available for backward compatibility).

Arguments

Certificate

contains the certificate that has formerly been given to setPadsetting. Currently it is obsolete, replaced by XML certificate.

CheckPad

If set to true startCapture checks if the configured signature device is available to prevent crashing if the configured device is not connected (This may take a few additional seconds). If a Wintab device or a Tablet PC is used as signature device the check always succeeds because most wintab devices don't support a check if the hardware is physically connected.

AutostartSerching

If set to true startCapture starts automatically to search for another signature device if the configured signature device is not found (only possibile if CheckPad is set to true) or if no signature device has been configured at all.

showConnectionWinIfAutostart obsolete

If set to true the user will see the dialog "Please connect your Signatur device now" from the driver window before it starts to search a new signature device.

ReadAndSaveInRegistry

If set to true startCapture reads device setting from the registry and save new padsettings to registry if it was neccessary to search for a new signature device. If no configuration is stored in registry it will use the configuration from Padsettings if given.

Padsettings

Contains the PadSettings string as formerly given to setPadsettings. If it is necessary to search for a new pad startCapture returns the new settings in this variable (also if ReadAndSaveInRegistry is set to true). If ReadAndSaveInRegistry is set to true you can always handle an empty string to padsettings. If you using an empty Padsettings Value, startCapture function will show the Padsearch Dialog. If you doesn´t want this Padsearch Dialog you should run the Pad search first, for example with checkConnectedPad or EnumeratePadsFirst and Next functions.

Return value

startCapture returns True if it was possible to start the signature capturing with a signature device. If signing hasn't been started, function returns false and set extended error code which can be read with the help of  GetSOPadError call.

Possible error codes are listed below:

  • SOPAD_ERROR_SET_MODE_FAILED
  • SOPAD_ERROR_DEVICE_FILTERED_OUT
  • SOPAD_ERROR_DEVICE_OPENED
  • SOPAD_ERROR_INVALID_PUBLIC_KEY
  • SOPAD_ERROR_SECURITY_RESTRICTION

See also

GetSOPadError

Driver error codes

Sample

C#
// Start signing
             
string padSettings = "";
string cert = ""; 	//	this value is obsolete
bool checkPad = true;
bool autostartSearching = true;
bool showConnectionWinIfAutostart = true;
bool readAndSaveInRegistry = false;

Capturing = SigDev.startCapture(cert, checkPad, autostartSearching, showConnectionWinIfAutostart, readAndSaveInRegistry, ref padSettings);