I'm trying to use an ActiveX that works with a signing pad hardware. It contains a method to display a standard dialog to pickup a signature. When executed it looks like this:
After clicking [OK] the application aborts without showing any type of message. Clicking on [Clear] or [Cancel] work as expected. The error can't be trapped with TRY-CATCH-END. All other properties and methods seem to work just fine.
Here is part of the code:
- Code: Select all Expand view
//------------------------------------------------------------------------//
METHOD New( ) CLASS TePad
local lOk := .t.
local oErr
DEFINE WINDOW ::oWnd FROM -300, -300 TO -300, -300 //hidden
TRY
::oActiveX := TActiveX():New( ::oWnd, "esW25COM.esCapture.1" )
::cDevice := ::oActiveX:GetProp( "ConnectedDevice" )
/*----------------------------------------------------------------------------
ConnectedDevice =
{98C174D3-6D2A-4509-96DB-D5B34FA7A561}: Interlink ePadInk
{7FCD9512-8763-436E-8747-40972EE28EFD}: Interlink ePad
{C55C5D54-8A92-48AD-A32F-1FC58092A581}: Interlink ePadID
------------------------------------------------------------------------------*/
CATCH oErr
::end()
Return Nil
END
RETURN Self
//------------------------------------------------------------------------//
METHOD SetProp() CLASS TePad
::oActiveX:SetProp( "SignDlgCaption", ::cCaption )
::oActiveX:SetProp( "DisplayName", ::cDispName )
::oActiveX:SetProp( "ShowSignerName", 1 ) //true
::oActiveX:SetProp( "EnableAntiAliasing", 1 )
RETURN NIL
//------------------------------------------------------------------------//
METHOD PickUpSignature() CLASS TePad
local nRet
TRY
nRet := ::oActiveX:Do( "StartSign" , 0, 1 )
CATCH
logfile( "trace.log", {"catched with errors"})
END
Logfile( "trace.log", { "Just testing", ::cDevice } )
Return nRet
To execute I simply do this:
- Code: Select all Expand view
Static Function Test()
Local oSign := TePad():New()
if oSign <> nil
oSign:cCaption := "Get Patient Signature Dialog"
oSign:cDispName := ProperPatName( odbf ) + " Or Guardian"
oSign:SetProp()
oSign:PickUpSignature()
oSign:End()
endif
Any ideas how to debug this problem?
Reinaldo.