How to call Events from OLE/COM objects

How to call Events from OLE/COM objects

Postby Giovany Vecchi » Thu Apr 21, 2022 7:35 pm

I'm trying to make a class for the persona digital reader. I don't know how to trigger or call EVENT type functions.
I read the harbor classes documentation and couldn't find anything on the subject.
If I create a class in _XAILER_ the EVENT functions appear.
Does anyone know how to make this work in HARBOUR.
I'm using Win_OleCreateObject.

Look at the class that _Xailer_ created.
Code: Select all  Expand view  RUN

#include "-.ch"
#include "DPFPEnrollmentControl.ch"

CLASS TDPFPEnrollmentControl FROM TOcx

   // DigitalPersona Fingerprint Enrollment Control
   PROPERTY cCLSID INIT "DPFPActX.DPFPEnrollmentControl.1"

PUBLISHED:

   /* Gets the maximum number of fingers that can be enrolled. */
   PROPERTY MaxEnrollFingerCount ID 1 AS NUMERIC

   /* Gets the mask representing the user’s enrolled fingers. */
   PROPERTY EnrolledFingersMask ID 2 AS NUMERIC

   /* Gets the serial number of a fingerprint reader that captures a fingerprint sample. */
   PROPERTY ReaderSerialNumber ID 3 AS CHARACTER

   /* Fires when a user deletes a finger. */
   EVENT OnDelete( nlFingerMask, disppStatus )

   /* Fires when a user enrolls a finger. */
   EVENT OnEnroll( nlFingerMask, disppTemplate, disppStatus )

   /* Fires when a user touches a fingerprint reader */
   EVENT OnFingerTouch( cpSerialNumber, nlEnrolledFinger )

   /* Fires when a user removes a finger from a fingerprint reader */
   EVENT OnFingerRemove( cpSerialNumber, nlEnrolledFinger )

   /* Fired on a successful scan */
   EVENT OnComplete( cpSerialNumber, nlEnrolledFinger )

   /* Fired when a reader is connected */
   EVENT OnReaderConnect( cpSerialNumber, nlEnrolledFinger )

   /* Fired when a reader is disconnected */
   EVENT OnReaderDisconnect( cpSerialNumber, nlEnrolledFinger )

   /* Fired when a fingerprint sample is received */
   EVENT OnSampleQuality( cpSerialNumber, nlEnrolledFinger, nlSampleQuality )

   /* Fires when enrollment has begun */
   EVENT OnStartEnroll( cpSerialNumber, nlEnrolledFinger )

   /* Fires when enrollment is cancelled */
   EVENT OnCancelEnroll( cpSerialNumber, nlEnrolledFinger )

PUBLIC:

ENDCLASS

 
User avatar
Giovany Vecchi
 
Posts: 223
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: How to call Events from OLE/COM objects

Postby Jimmy » Thu Apr 21, 2022 10:45 pm

hi,

i "think" you have to fill Codeblock Slot
Code: Select all  Expand view  RUN
bOnEvent

have a look here
c:\fwh\samples\mappt.prg
c:\fwh\samples\media.prg
c:\fwh\samples\ribonbar.prg
c:\fwh\samples\schedule.prg
c:\fwh\samples\webexp.prg
c:\fwh\samples\webexp3.prg
c:\fwh\samples\webexph.prg
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: How to call Events from OLE/COM objects

Postby Giovany Vecchi » Fri Apr 22, 2022 2:02 pm

Hi Jimmy, The control is not ActiveX. I start using Win_OleCreateObject because it didn't work with tActivex().
I did tests using __axRegisterHandler and I didn't get exodus either.
A simple test in C# shown in this link I can't call the ConvertToPicture() event. Maybe it's my ignorance in this aspect, or Harbou/FW doesn't have these features for OLE/COM.
Example:

https://stackoverflow.com/questions/45493824/fingerprint-scanning-with-digitalpersona-4500-reader-how-to-get-captured-image
User avatar
Giovany Vecchi
 
Posts: 223
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: How to call Events from OLE/COM objects

Postby Jimmy » Fri Apr 22, 2022 8:17 pm

hi Giovan ,

a *.DLL "can" be a ActiveX when use IDispatch Interface

but i saw that it say " Windows SDK .NET Edition" which work different to Win32 API.
no Idea how to use .NET DLL under FiveWin
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: How to call Events from OLE/COM objects

Postby Giovany Vecchi » Fri Apr 22, 2022 8:24 pm

Jimmy, In vb6 it doesn't use .NET, and the example is very simple. I just can't get it to work in harbor.

Code: Select all  Expand view  RUN

VERSION 5.00
Object = "{B49E66FF-6927-4378-9685-937F14679ADD}#1.0#0"; "DPFPCtlX.dll"
Begin VB.Form VerificationDialog
   Caption         =   "Verify Your Identity"
   ClientHeight    =   2085
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4920
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   '
False
   ScaleHeight     =   2085
   ScaleWidth      =   4920
   StartUpPosition =   2  'CenterScreen
   Begin DPFPCtlXLibCtl.DPFPVerificationControl DPFPVerificationControl1
      Height          =   735
      Left            =   3960
      TabIndex        =   2
      TabStop         =   0   '
False
      Top             =   360
      Width           =   735
      _cx             =   1296
      _cy             =   1296
      ReaderSerialNumber=   "{00000000-0000-0000-0000-000000000000}"
   End
   Begin VB.CommandButton Close
      Caption         =   "Close"
      Height          =   375
      Left            =   3360
      TabIndex        =   0
      Top             =   1560
      Width           =   1455
   End
   Begin VB.Label Label1
      Caption         =   "To verify your identity, touch fingerprint reader with any enrolled finger."
      Height          =   735
      Left            =   240
      TabIndex        =   1
      Top             =   360
      Width           =   3375
   End
End
Attribute VB_Name = "VerificationDialog"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Ver As DPFPVerification

Private Sub Form_Load()
 ' Create DPFPVerification object.
 Set Ver = New DPFPVerification
End Sub

Private Sub Close_Click()
 Unload Me
End Sub

Private Sub DPFPVerificationControl1_OnComplete(ByVal Ftrs As Object, ByVal Stat As Object)
 Dim Res As Object
 Dim Templ As Object
 '
Compare feature set with all stored templates.
 For i = 0 To 10
    ' Get template from storage.
    Set Templ = MainForm.GetTemplate(i)
    If Templ Is Nothing Then
    Else
        '
Compare feature set with particular template.
        Set Res = Ver.Verify(Ftrs, Templ)
        ' If match, exit from loop.
        If Res.Verified = True Then Exit For
    End If
 Next
 If Res Is Nothing Then
  Stat.Status = EventHandlerStatusFailure
  Exit Sub
 ElseIf Res.Verified = False Then
  '
If non-match, notify caller.
  Stat.Status = EventHandlerStatusFailure
  MainForm.Verified.Value = 0
 Else
  MainForm.Verified.Value = 1
 End If
 ' Show false accept rate.
 MainForm.FAR.Caption = Res.FARAchieved
 End Sub
User avatar
Giovany Vecchi
 
Posts: 223
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: How to call Events from OLE/COM objects

Postby Jimmy » Sat Apr 23, 2022 5:09 am

hi,

i have read about "DigitalPersona One Touch For Windows SDK .NET" in that Link you posted
i have download

DigitalPersona, Inc.
One Touch® for Windows® SDK
COM/ActiveX® Edition

which work with C/C++, COM/ActiveX, .NET and Java

---

i do not understand VB ...

on Page 22 of \Docs\One Touch for Windows SDK COM-ActiveX Developer Guide.pdf
Fingerprint Sample Capture
1. *Create an instance of a DPFPCapture object (VB page36, C++ page78).
2. *Implement an event handler for DPFPCaptureEvents event notifications (VB page38, C++
page81).


i "guess" when run SDK Setup it will "register" dpicacnt.dll
and use CLSID {B49E66FF-6927-4378-9685-937F14679ADD}

---

as it need DigitalPersona Hardware i can not "test-drive" it
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: How to call Events from OLE/COM objects

Postby Giovany Vecchi » Tue Apr 26, 2022 2:33 pm

Hi Jimmy, I'm going to change the reader, I saw it here on the forum to use the hamster reader. I think activex and the harbor ole/com system don't have these features.
I'll leave the class I was doing here.
Code: Select all  Expand view  RUN

//Classe DigPersonaEnrollment / 18/08/2021 - 17:56
#Include "FiveWin.ch"


// DPFPEventHandlerStatusEnum
#Define df_EventHandlerStatusSuccess                    0
#Define df_EventHandlerStatusFailure                    1

// DPFPReaderSerialNumberTypeEnum
#Define df_ReaderSerialNumberTypePersistent         0
#Define df_ReaderSerialNumberTypeVolatile               1

// DPFPReaderImpressionTypeEnum
#Define df_ReaderImpressionTypeUnknown                  0
#Define df_ReaderImpressionTypeSwipe                    1
#Define df_ReaderImpressionTypeArea                     2

// DPFPReaderTechnologyEnum
#Define df_ReaderTechnologyUnknown                      0
#Define df_ReaderTechnologyOptical                      1
#Define df_ReaderTechnologyCapacitive                   2
#Define df_ReaderTechnologyThermal                      3
#Define df_ReaderTechnologyPressure                     4

// DPFPCapturePriorityEnum
#Define df_CapturePriorityLow                               0
#Define df_CapturePriorityNormal                            1
#Define df_CapturePriorityHigh                          2

// DPFPCaptureFeedbackEnum
#Define df_CaptureFeedbackGood                          0
#Define df_CaptureFeedbackNone                          1
#Define df_CaptureFeedbackTooLight                      2
#Define df_CaptureFeedbackTooDark                       3
#Define df_CaptureFeedbackTooNoisy                      4
#Define df_CaptureFeedbackLowContrast                   5
#Define df_CaptureFeedbackNotEnoughFtrs             6
#Define df_CaptureFeedbackNoCentralRgn                  7
#Define df_CaptureFeedbackNoFinger                      8
#Define df_CaptureFeedbackTooHigh                       9
#Define df_CaptureFeedbackTooLow                            10
#Define df_CaptureFeedbackTooLeft                       11
#Define df_CaptureFeedbackTooRight                      12
#Define df_CaptureFeedbackTooStrange                    13
#Define df_CaptureFeedbackTooFast                       14
#Define df_CaptureFeedbackTooSkewed                     15
#Define df_CaptureFeedbackTooShort                      16
#Define df_CaptureFeedbackTooSlow                       17


// DPFPTemplateStatusEnum
#Define df_TemplateStatusUnknown                            0
#Define df_TemplateStatusInsufficient                   1
#Define df_TemplateStatusCreationFailed             2
#Define df_TemplateStatusTemplateReady                  3

// DPFPDataPurposeEnum
#Define df_DataPurposeUnknown                               0
#Define df_DataPurposeVerification                      1
#Define df_DataPurposeEnrollment                            2



Class DigPersonaEnrollment

    ////////////////////////////////////////////////////////////////////////////////////////////////
    // DigitalPersona Fingerprint Enrollment Control Activex Object
    Data cCLSID_ActxEnrollmentControl               INIT "DPFPActX.DPFPEnrollmentControl.1"
    Data oActx391_EnrollmentControl

    Data cCLSID_VerificationControl                 INIT "DPFPActX.DPFPVerificationControl.1"

    ////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////
    // DPFPCtlXLib > DigitalPersona One Touch for Windows Control 1.0
    // Fingerprint Enrollment Control Class
    Data cCLSID_EnrollmentControl               INIT "{0B4409EF-FD2B-4680-9519-D18C528B265E}" // Or "DPFPActX.DPFPEnrollmentControl.1"
    Data oEnrollmentControl
    // Gets the maximum number of fingers that can be enrolled.
    //  function Get_MaxEnrollFingerCount: LongInt
    // Gets the maximum number of fingers that can be enrolled.
    //  procedure Set_MaxEnrollFingerCount(const Param1: LongInt)
    // Gets the mask representing the user’s enrolled fingers.
    //  function Get_EnrolledFingersMask: LongInt
    // Gets the mask representing the user’s enrolled fingers.
    //  procedure Set_EnrolledFingersMask(const Param1: LongInt)
    // Gets the serial number of a fingerprint reader that captures a fingerprint sample.
    //  function Get_ReaderSerialNumber: WideString
    // Gets the serial number of a fingerprint reader that captures a fingerprint sample.
    //  procedure Set_ReaderSerialNumber(const Param1: WideString)
    // EVENTS
    // Fires when a user deletes a finger.
    //  procedure OnDelete(const lFingerMask: LongInt; const pStatus: IDispatch): HRESULT
    // Fires when a user enrolls a finger.
    //  procedure OnEnroll(const lFingerMask: LongInt; const pTemplate: IDispatch; const pStatus: IDispatch): HRESULT
    // Fires when a user touches a fingerprint reader
    //  procedure OnFingerTouch(const pSerialNumber: WideString; const lEnrolledFinger: LongInt): HRESULT
    // Fires when a user removes a finger from a fingerprint reader
    //  procedure OnFingerRemove(const pSerialNumber: WideString; const lEnrolledFinger: LongInt): HRESULT
    // Fired on a successful scan
    //  procedure OnComplete(const pSerialNumber: WideString; const lEnrolledFinger: LongInt): HRESULT
    // Fired when a reader is connected
    //  procedure OnReaderConnect(const pSerialNumber: WideString; const lEnrolledFinger: LongInt): HRESULT
    // Fired when a reader is disconnected
    //  procedure OnReaderDisconnect(const pSerialNumber: WideString; const lEnrolledFinger: LongInt): HRESULT
    // Fired when a fingerprint sample is received
    //  procedure OnSampleQuality(const pSerialNumber: WideString; const lEnrolledFinger: LongInt; const lSampleQuality: LongInt): HRESULT
    // Fires when enrollment has begun
    //  procedure OnStartEnroll(const pSerialNumber: WideString; const lEnrolledFinger: LongInt): HRESULT
    // Fires when enrollment is cancelled
    //  procedure OnCancelEnroll(const pSerialNumber: WideString; const lEnrolledFinger: LongInt): HRESULT

    //--------------------------------------------------------------------------------------------//
    // Fingerprint Verification Control Class
    Data cCLSID_VerificationControl         INIT "{F4AD5526-3497-4B8C-873A-A108EA777493}"
    Data oVerificationControl
    // Gets the serial number of a fingerprint reader that captures a fingerprint sample.
    //  function Get_ReaderSerialNumber: WideString
    // Gets the serial number of a fingerprint reader that captures a fingerprint sample.
    //  procedure Set_ReaderSerialNumber(const Param1: WideString)
    // Returns fingerprint capture state
    //  function Get_Active: WordBool
    // Returns fingerprint capture state
    //  procedure Set_Active(const Param1: WordBool)

    //--------------------------------------------------------------------------------------------//
    // Event Handler Status Class
    Data cCLSID_EventHandlerStatus          INIT "{9D370792-0515-4E12-B791-5C6DF130CEC5}"
    Data oEventHandlerStatus
    // Gets the status of an operation.
    // function Get_Status: DPFPEventHandlerStatusEnum
    // Gets the status of an operation.
    // procedure Set_Status(const Param1: DPFPEventHandlerStatusEnum)

    ////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////
    // DPFPDevXLib > DigitalPersona One Touch for Windows Device components 1.0
    // Sample Converter Class
    Data cCLSID_SampleConversion                INIT "{F6CEDB0E-A5F3-4C9C-BDB0-58B2BC9A4BF3}"
    Data oSampleConversion
    // Converts a fingerprint sample to an IPicture object.
    //      function ConvertToPicture(const pSample: IDispatch): IDispatch
    // Converts a fingerprint sample to an image in ANSI 381 format.
    //      function ConvertToANSI381(const pSample: IDispatch): Variant

    //--------------------------------------------------------------------------------------------//
    // Fingerprint Sample Capture Class
    Data cCLSID_Capture                         INIT "{3FA859DA-300C-4247-BD33-6011198399C0}"
    Data oCapture
    // Begins capturing a fingerprint sample from a fingerprint reader.
    //      procedure StartCapture
    // Stops a fingerprint sample capture operation.
    //      procedure StopCapture
    // Gets the serial number of a fingerprint reader that captures a fingerprint sample.
    //      function Get_ReaderSerialNumber: WideString
    // Gets the serial number of a fingerprint reader that captures a fingerprint sample.
    //      procedure Set_ReaderSerialNumber(const Param1: WideString); dispid 3;
    // Gets the priority of a fingerprint sample capture operation.
    //      function Get_Priority: DPFPCapturePriorityEnum; dispid 4;
    // Gets the priority of a fingerprint sample capture operation.
    //      procedure Set_Priority(const Param1: DPFPCapturePriorityEnum)

    //--------------------------------------------------------------------------------------------//
    // Fingerprint Reader Description Class
    Data cCLSID_ReaderDescription               INIT "{0A611435-B092-45C7-B928-137255359B7A}"
    Data oReaderDescription
    // Gets the fingerprint reader serial number.
    //      function Get_SerialNumber: WideString
    // Gets the fingerprint reader serial number type.
    //      function Get_SerialNumberType: DPFPReaderSerialNumberTypeEnum
    // Gets the fingerprint reader impression type.
    //      function Get_ImpressionType: DPFPReaderImpressionTypeEnum
    // Gets the fingerprint reader technology.
    //      function Get_Technology: DPFPReaderTechnologyEnum
    // Gets the fingerprint reader language.
    //      function Get_LanguageID: LongInt
    // Gets the fingerprint reader vendor name.
    //      function Get_Vendor: WideString
    // Gets the fingerprint reader product name.
    //      function Get_ProductName: WideString
    // pGets the fingerprint reader hardware revision number.
    //      function Get_HardwareRevision: WideString
    // Gets the reader firmware revision number.
    //      function Get_FirmwareRevision: WideString

    //--------------------------------------------------------------------------------------------//
    // Fingerprint Readers Manager Class
    Data cCLSID_ReadersCollection               INIT "{2BF17AC6-58B6-4AF2-82A3-1DD4C4F99CE2}"
    Data oReadersCollection
    // Gets the total number of fingerprint readers connected to a system.
    //  function Get_Count: LongInt
    // Creates an instance of DPFPReaderDescription for a particular fingerprint reader using its serial number.
    //  function Reader(const ReaderSerialNumber: WideString): IDispatch
    // Gets a DPFPReaderDescription object from the readers connected to a system using its index.
    //  function Get_Item(const lDevice: LongInt): IDispatch
    // Gets a pointer to an array of DPFPReaderDescription objects.
    //  function Get__NewEnum: IUnknown


    ////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////
    // DPFPEngXLib > DigitalPersona One Touch for Windows Engine components 1.0
    // Fingerprint Feature Set Creator Class
    Data cCLSID_FeatureExtraction               INIT "{C64055AD-8960-4429-BDB4-2E102F47BD9A}"
    Data oFeatureExtraction
    // Creates a fingerprint feature set for a specified purpose.
    //      function CreateFeatureSet(const pSample: IDispatch; const Purpose: DPFPDataPurposeEnum):DPFPCaptureFeedbackEnum
    // Gets a DPFPFeatureSet object created during a fingerprint feature extraction operation.
    //      function Get_FeatureSet: IDispatch

    //--------------------------------------------------------------------------------------------//
    // Fingerprint Template Creator Class
    Data cCLSID_Enrollment                      INIT "{1E1020EF-4A4F-430D-A351-427821B177B2}"
    Data oEnrollment
    // Gets the number of fingerprint feature sets still needed to create a fingerprint template.
    //      function Get_FeaturesNeeded: LongInt
    // Gets the status of a fingerprint template creation operation.
    //      function Get_TemplateStatus: DPFPTemplateStatusEnum
    // Gets a DPFPTemplate object created during an enrollment operation.
    //      function Get_Template: IDispatch
    // Adds fingerprint feature sets, one-by-one, to a fingerprint template.
    //      procedure AddFeatures(const pFeatures: IDispatch)

    //--------------------------------------------------------------------------------------------//
    // Fingerprint Verification Class
    Data cCLSID_Verification                    INIT "{8B7A9D29-5C11-464F-A058-BFA8024805CE}"
    Data oVerification
    // Gets the requested false accept rate (FAR).
    //      function Get_FARRequested: LongInt
    // Gets the requested false accept rate (FAR).
    //      procedure Set_FARRequested(const Param1: LongInt)
    // Performs the system function of fingerprint verification and returns a comparison decision.
    //      function Verify(const pFeatureSet: IDispatch; const pTemplate: IDispatch): IDispatch

    //--------------------------------------------------------------------------------------------//
    // Fingerprint Verification Result Class
    Data cCLSID_VerificationResult          INIT "{B2D559AE-F070-4C2A-9D99-6E68DA0B1E8E}"
    Data oVerificationResult
    // Gets a comparison decision.
    //      function Get_Verified: WordBool; dispid 1;
    // Gets the achieved FAR for a comparison operation.
    //      function Get_FARAchieved: LongInt

    ////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////
    // DPFPShrXLib > DigitalPersona One Touch for Windows Shared components 1.0
    // Fingerprint Feature Set Class
    Data cCLSID_FeatureSet                      INIT "{A93BFBD6-93A0-4DBD-92F8-0D2DD80F0824}"
    Data oFeatureSet
    // Serializes a fingerprint data object.
    //      function Serialize: Variant
    // Deserializes a serialized fingerprint data object.
    //      procedure Deserialize(const RawData: Variant)

    //--------------------------------------------------------------------------------------------//
    // Fingerprint Sample Class
    Data cCLSID_Sample                          INIT "{D005543B-EA11-499D-B3EA-37266D74BE79}"
    Data oSample
    // Serializes a fingerprint data object.
    //      function Serialize: Variant
    // Deserializes a serialized fingerprint data object.
    //      procedure Deserialize(const RawData: Variant)

    //--------------------------------------------------------------------------------------------//
    // Fingerprint Template Class
    Data cCLSID_Template                            INIT "{3926DADA-23CD-42BD-818E-2AAA37522307}"
    Data oTemplate
    // Serializes a fingerprint data object.
    //      function Serialize: Variant
    // Deserializes a serialized fingerprint data object.
    //      procedure Deserialize(const RawData: Variant)


    /* Gets the maximum number of fingers that can be enrolled. */
    Data nMaxEnrollFingerCount          AS NUMERIC      INIT 10

    /* Gets the mask representing the user’s enrolled fingers. */
    Data nEnrolledFingersMask           AS NUMERIC      INIT 0

    /* Gets the serial number of a fingerprint reader that captures a fingerprint sample. */
    Data cReaderSerialNumber            AS CHARACTER    INIT "{00000000-0000-0000-0000-000000000000}"

    Data cCLSID_EventHandlerStatus          INIT "{9D370792-0515-4E12-B791-5C6DF130CEC5}"
    Data oIDPFPEventHandlerStatus              

    Data cErrorTxtReturn                // Txt error: Method Name + catch oError
    Data lActivexInstaled           // Drivers Digital Persona Instaled
    Data lErrorCatch                    // if you have catch errors
    Data lSaveLogs                      // If true, write logs to cFileLogs (Default .F.    )
    Data cFileLogs                      // file with event logs                

    Data oWndEnrollment, oDlgEnrollment

    Data oTst

    Method New() Constructor
    Method End()

    Method DigPersonaEnrollment_Start(f_lUiSuport)
    Method DigPersonaEnrollment_Event(f_uEvent, f_aParams, f_pParams)

    Method DigPersonaEnrollment_OnComplete(f_cReaderSerNum)

    Method DigPersonaEnrollment_DPFPCtlXLib_Control_Build()         // Build Class in DPFPCtlX.dll
    Method DigPersonaEnrollment_DPFPDevXLib_Device_Build()              // Build Class in DPFPDevX.dll
    Method DigPersonaEnrollment_DPFPEngXLib_Engine_Build()              // Build Class in DPFPEngX.dll
    Method DigPersonaEnrollment_DPFPShrXLib_Shared_Build()              // Build Class in DPFPShrX.dll

    Method DigPersonaEnrollment_UiSuport()
    Method DigPersonaEnrollment_Confirmar()
   
    Method DigPersonaEnrollment_Capture()

EndClass
//-----------------------------------------------------------------------------
Method New() Class DigPersonaEnrollment

    ::cErrorTxtReturn           := ""
    ::lErrorCatch               := .F.
    ::lActivexInstaled      := .F.

    ::lSaveLogs                 := .T.
    ::cFileLogs                 := DIR_TEMP()+"_DigPerEnrollment.txt"

    if hb_FileExists(::cFileLogs)
        FErase(::cFileLogs)
    EndIf

Return Self
//-----------------------------------------------------------------------------
Method End() Class DigPersonaEnrollment

Return Nil
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_Start(f_lUiSuport) Class DigPersonaEnrollment
    Local lc_oError
    Local lc_oSelf := Hb_qSelf()

    Default f_lUiSuport := .F.

    /*
    If !isActiveX(::cCLSID_ActxEnrollmentControl)
        ::cErrorTxtReturn := "Digital Persona Drivers Not Found"
        Return .F.
    else
        ::lActivexInstaled := .T.
    EndIf
    */


    //If !f_lUiSuport
        If !::DigPersonaEnrollment_DPFPCtlXLib_Control_Build()
            Return .F.
        EndIf
    //EndIf
    If !::DigPersonaEnrollment_DPFPDevXLib_Device_Build()
        Return .F.
    EndIf
    If !::DigPersonaEnrollment_DPFPEngXLib_Engine_Build()
        Return .F.
    EndIf
    If !::DigPersonaEnrollment_DPFPShrXLib_Shared_Build()
        Return .F.
    EndIf
   
    //::oCapture:StartCapture()

    //If f_lUiSuport
        ::DigPersonaEnrollment_UiSuport()
    //ENdIf

    //::DigPersonaEnrollment_Capture()
    //::oCapture:StartCapture()

    //? "dsc"

Return .T.
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_Event(f_uEvent, f_aParams, f_pParams,f_tst) Class DigPersonaEnrollment
    Local lc_cMsg := "", lc_cEventTarget := ""
    Local lc_iFor := 0, lc_aTmp := {0,0}
    Local lc_hWnd, lc_nParamsCount := 0
   
    lc_cEventTarget := cValToChar( f_uEvent )
    lc_cMsg                 := "Event: "    + lc_cEventTarget + " > Type: " + ValType(f_uEvent) +CRLF
    lc_cMsg                 += "Params: "   + CRLF

    For lc_iFor := 1 to Len( f_aParams )
        lc_cMsg += cValToChar( f_aParams[ lc_iFor ] ) + " > Type: "+ValType(f_aParams[ lc_iFor ])+ CRLF
        lc_nParamsCount ++
    next

    lc_cMsg += "pParams"+CRLF
    For lc_iFor := 1 to Len( f_pParams )
        lc_cMsg += cValToChar( f_pParams[ lc_iFor ] ) + " > Type: "+ValType(f_pParams[ lc_iFor ] )+ CRLF
        lc_nParamsCount ++
    next

    //SetEventParam( f_pParams, 7, .t. ) // Comment this to allow navigation
    //logfile(::cFileLogs,f_pParams)

    If Upper(lc_cEventTarget) == "ONCOMPLETE"
        //? ValType(f_aParams[1])
        //? ValType(f_uEvent)
        //xBrowse(f_pParams)
        ::DigPersonaEnrollment_OnComplete(f_aParams[1])
        //::oActx391_EnrollmentControl:OnComplete(f_aParams[1])
    EndIf

    If Upper(lc_cEventTarget) == "ONENROLL"
        //? ValType(f_aParams[1])
        //? ValType(f_uEvent)
        //xBrowse(f_aParams[3])
        OBJECT_EXPLORER(f_aParams[3])
        //::DigPersonaEnrollment_OnComplete(f_aParams[1])
        //::oActx391_EnrollmentControl:OnComplete(f_aParams[1])
    EndIf

    If ::lSaveLogs
        logfile(::cFileLogs,lc_cMsg,.F.)
    EndIf

Return Nil
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_OnComplete(f_cReaderSerNum) Class DigPersonaEnrollment
    Local lc_oSelf := Hb_qSelf()
    Local lc_oBmp
    locaL Lc_otst

    //OBJECT_EXPLORER(f_cReaderSerNum)

    //Define Bitmap lc_oBmp

    //lc_obmp := CreateCompatibleBitmap(GetDC( GetDesktopWindow()),200,200)
 
    ///::oEnrollmentControl:OnComplete(f_cReaderSerNum,@Lc_otst)
    ///Lc_otst := Win_OleCreateObject(::cCLSID_SampleConversion)
   
    //syswait(4)

    //::oSample:Serialize()
    //Lc_otst:Serialize()
    ///? ::oSampleConversion:ConvertToPicture(::oSample)
   
    //xBrowse(::oSample)
    //OBJECT_EXPLORER(::oActx391_EnrollmentControl:DPFPCapture)
 
    //xBrowse(::oActx391_EnrollmentControl)
    //xBrowse(::oIDPFPEventHandlerStatus:Status())
    //xBrowse(::oActx391_EnrollmentControl:EnrolledFingersMask)

Return nil
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_DPFPCtlXLib_Control_Build() Class DigPersonaEnrollment
    Local lc_oError

    Try
        ::oEventHandlerStatus   := Win_OleCreateObject(::cCLSID_EventHandlerStatus)
    catch lc_oError
    ::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPCtlXLib_Control_Build"+CRLF
    ::cErrorTxtReturn := "Instance IDPFPEventHandlerStatus"+CRLF
    ::cErrorTxtReturn +=    "Error: "       + Transform(lc_oError:GenCodenil) + CRLF +;
                                "SubC: "            + Transform(lc_oError:SubCodenil) + CRLF +;
                                "OSCode: "      + Transform(lc_oError:OsCode,       nil) + CRLF +;
                                "SubSystem: "   + Transform(lc_oError:SubSystem,    nil) + CRLF +;
                                "Mensagem: "    + lc_oError:Description
        ::lErrorCatch := .T.
    End Try

    If ::lErrorCatch
        Return .F.
    EndIf
    //OBJECT_EXPLORER(::oEventHandlerStatus, "IDPFPEventHandlerStatus")

    Try
        ::oVerificationControl  := Win_OleCreateObject(::cCLSID_VerificationControl)
    catch lc_oError
    ::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPCtlXLib_Control_Build"+CRLF
    ::cErrorTxtReturn := "Instance IDPFPVerificationControl"+CRLF
    ::cErrorTxtReturn +=    "Error: "       + Transform(lc_oError:GenCodenil) + CRLF +;
                                "SubC: "            + Transform(lc_oError:SubCodenil) + CRLF +;
                                "OSCode: "      + Transform(lc_oError:OsCode,       nil) + CRLF +;
                                "SubSystem: "   + Transform(lc_oError:SubSystem,    nil) + CRLF +;
                                "Mensagem: "    + lc_oError:Description
        ::lErrorCatch := .T.
    End Try

    If ::lErrorCatch
        Return .F.
    EndIf
    //OBJECT_EXPLORER(::oVerificationControl, "IDPFPVerificationControl")

    Try
        ::oEnrollmentControl    := Win_OleCreateObject(::cCLSID_EnrollmentControl)
    catch lc_oError
    ::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPCtlXLib_Control_Build"+CRLF
    ::cErrorTxtReturn := "Instance IDPFPEnrollmentControl"+CRLF
    ::cErrorTxtReturn +=    "Error: "       + Transform(lc_oError:GenCodenil) + CRLF +;
                                "SubC: "            + Transform(lc_oError:SubCodenil) + CRLF +;
                                "OSCode: "      + Transform(lc_oError:OsCode,       nil) + CRLF +;
                                "SubSystem: "   + Transform(lc_oError:SubSystem,    nil) + CRLF +;
                                "Mensagem: "    + lc_oError:Description
        ::lErrorCatch := .T.
    End Try

    If ::lErrorCatch
        Return .F.
    EndIf
    //OBJECT_EXPLORER(::oEnrollmentControl, "IDPFPEnrollmentControl")

Return .T.
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_DPFPDevXLib_Device_Build() Class DigPersonaEnrollment
    Local lc_oError

    Try
        ::oReaderDescription    := Win_OleCreateObject(::cCLSID_ReaderDescription)
    catch lc_oError
    ::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPDevXLib_Device_Build"+CRLF
    ::cErrorTxtReturn := "Instance IDPFPReaderDescription"+CRLF
    ::cErrorTxtReturn +=    "Error: "       + Transform(lc_oError:GenCodenil) + CRLF +;
                                "SubC: "            + Transform(lc_oError:SubCodenil) + CRLF +;
                                "OSCode: "      + Transform(lc_oError:OsCode,       nil) + CRLF +;
                                "SubSystem: "   + Transform(lc_oError:SubSystem,    nil) + CRLF +;
                                "Mensagem: "    + lc_oError:Description
        ::lErrorCatch := .T.
    End Try

    If ::lErrorCatch
        Return .F.
    EndIf
    //OBJECT_EXPLORER(::oReaderDescription, "IDPFPReaderDescription")

    Try
        ::oReadersCollection    := Win_OleCreateObject(::cCLSID_ReadersCollection)
    catch lc_oError
    ::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPDevXLib_Device_Build"+CRLF
    ::cErrorTxtReturn := "Instance cCLSID_ReadersCollection"+CRLF
    ::cErrorTxtReturn +=    "Error: "       + Transform(lc_oError:GenCodenil) + CRLF +;
                                "SubC: "            + Transform(lc_oError:SubCodenil) + CRLF +;
                                "OSCode: "      + Transform(lc_oError:OsCode,       nil) + CRLF +;
                                "SubSystem: "   + Transform(lc_oError:SubSystem,    nil) + CRLF +;
                                "Mensagem: "    + lc_oError:Description
        ::lErrorCatch := .T.
    End Try

    If ::lErrorCatch
        Return .F.
    EndIf
    //OBJECT_EXPLORER(::oReadersCollection, "cCLSID_ReadersCollection")

    Try
        ::oCapture  := Win_OleCreateObject(::cCLSID_Capture)
    catch lc_oError
    ::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPDevXLib_Device_Build"+CRLF
    ::cErrorTxtReturn := "Instance IDPFPCaptureEvents"+CRLF
    ::cErrorTxtReturn +=    "Error: "       + Transform(lc_oError:GenCodenil) + CRLF +;
                                "SubC: "            + Transform(lc_oError:SubCodenil) + CRLF +;
                                "OSCode: "      + Transform(lc_oError:OsCode,       nil) + CRLF +;
                                "SubSystem: "   + Transform(lc_oError:SubSystem,    nil) + CRLF +;
                                "Mensagem: "    + lc_oError:Description
        ::lErrorCatch := .T.
    End Try

    If ::lErrorCatch
        Return .F.
    EndIf
    //OBJECT_EXPLORER(::oCapture, "IDPFPCaptureEvents")
    ::oCapture:__hSink := __axRegisterHandler( ::oCapture:__hObj, {| _Par01,_Par02,_Par03,_Par04 | logfile(::cFileLogs,{_Par01,_Par02,_Par03,_Par04},.F.) } )

    Try
        ::oSampleConversion := Win_OleCreateObject(::cCLSID_SampleConversion)
    catch lc_oError
    ::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPDevXLib_Device_Build"+CRLF
    ::cErrorTxtReturn := "Instance IDPFPSampleConversion"+CRLF
    ::cErrorTxtReturn +=    "Error: "       + Transform(lc_oError:GenCodenil) + CRLF +;
                                "SubC: "            + Transform(lc_oError:SubCodenil) + CRLF +;
                                "OSCode: "      + Transform(lc_oError:OsCode,       nil) + CRLF +;
                                "SubSystem: "   + Transform(lc_oError:SubSystem,    nil) + CRLF +;
                                "Mensagem: "    + lc_oError:Description
        ::lErrorCatch := .T.
    End Try

    If ::lErrorCatch
        Return .F.
    EndIf
    //OBJECT_EXPLORER(::oSampleConversion, "IDPFPSampleConversion")


Return .T.
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_DPFPEngXLib_Engine_Build() Class DigPersonaEnrollment
    Local lc_oError

    Try
        ::oFeatureExtraction    := Win_OleCreateObject(::cCLSID_FeatureExtraction)
    catch lc_oError
    ::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPEngXLib_Engine_Build"+CRLF
    ::cErrorTxtReturn := "Instance IDPFPFeatureExtraction"+CRLF
    ::cErrorTxtReturn +=    "Error: "       + Transform(lc_oError:GenCodenil) + CRLF +;
                                "SubC: "            + Transform(lc_oError:SubCodenil) + CRLF +;
                                "OSCode: "      + Transform(lc_oError:OsCode,       nil) + CRLF +;
                                "SubSystem: "   + Transform(lc_oError:SubSystem,    nil) + CRLF +;
                                "Mensagem: "    + lc_oError:Description
        ::lErrorCatch := .T.
    End Try

    If ::lErrorCatch
        Return .F.
    EndIf
    //OBJECT_EXPLORER(::oFeatureExtraction, "IDPFPFeatureExtraction")

    Try
        ::oEnrollment   := Win_OleCreateObject(::cCLSID_Enrollment)
    catch lc_oError
    ::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPEngXLib_Engine_Build"+CRLF
    ::cErrorTxtReturn := "Instance IDPFPEnrollment"+CRLF
    ::cErrorTxtReturn +=    "Error: "       + Transform(lc_oError:GenCodenil) + CRLF +;
                                "SubC: "            + Transform(lc_oError:SubCodenil) + CRLF +;
                                "OSCode: "      + Transform(lc_oError:OsCode,       nil) + CRLF +;
                                "SubSystem: "   + Transform(lc_oError:SubSystem,    nil) + CRLF +;
                                "Mensagem: "    + lc_oError:Description
        ::lErrorCatch := .T.
    End Try

    If ::lErrorCatch
        Return .F.
    EndIf
    //OBJECT_EXPLORER(::oEnrollment, "IDPFPEnrollment")

    Try
        ::oVerification := Win_OleCreateObject(::cCLSID_Verification)
    catch lc_oError
    ::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPEngXLib_Engine_Build"+CRLF
    ::cErrorTxtReturn := "Instance IDPFPVerification"+CRLF
    ::cErrorTxtReturn +=    "Error: "       + Transform(lc_oError:GenCodenil) + CRLF +;
                                "SubC: "            + Transform(lc_oError:SubCodenil) + CRLF +;
                                "OSCode: "      + Transform(lc_oError:OsCode,       nil) + CRLF +;
                                "SubSystem: "   + Transform(lc_oError:SubSystem,    nil) + CRLF +;
                                "Mensagem: "    + lc_oError:Description
        ::lErrorCatch := .T.
    End Try

    If ::lErrorCatch
        Return .F.
    EndIf
    //OBJECT_EXPLORER(::oVerification, "IDPFPVerification")

    Try
        ::oVerificationResult   := Win_OleCreateObject(::cCLSID_VerificationResult)
    catch lc_oError
    ::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPEngXLib_Engine_Build"+CRLF
    ::cErrorTxtReturn := "Instance IDPFPVerificationResult"+CRLF
    ::cErrorTxtReturn +=    "Error: "       + Transform(lc_oError:GenCodenil) + CRLF +;
                                "SubC: "            + Transform(lc_oError:SubCodenil) + CRLF +;
                                "OSCode: "      + Transform(lc_oError:OsCode,       nil) + CRLF +;
                                "SubSystem: "   + Transform(lc_oError:SubSystem,    nil) + CRLF +;
                                "Mensagem: "    + lc_oError:Description
        ::lErrorCatch := .T.
    End Try

    If ::lErrorCatch
        Return .F.
    EndIf
    //OBJECT_EXPLORER(::oVerificationResult, "IDPFPVerificationResult")



Return .T.
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_DPFPShrXLib_Shared_Build() Class DigPersonaEnrollment
    Local lc_oError

    Try
        ::oFeatureSet   := Win_OleCreateObject(::cCLSID_FeatureSet)
    catch lc_oError
    ::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPShrXLib_Shared_Build"+CRLF
    ::cErrorTxtReturn := "Instance IDPFPFeatureSet"+CRLF
    ::cErrorTxtReturn +=    "Error: "       + Transform(lc_oError:GenCodenil) + CRLF +;
                                "SubC: "            + Transform(lc_oError:SubCodenil) + CRLF +;
                                "OSCode: "      + Transform(lc_oError:OsCode,       nil) + CRLF +;
                                "SubSystem: "   + Transform(lc_oError:SubSystem,    nil) + CRLF +;
                                "Mensagem: "    + lc_oError:Description
        ::lErrorCatch := .T.
    End Try

    If ::lErrorCatch
        Return .F.
    EndIf
    //OBJECT_EXPLORER(::oFeatureSet, "IDPFPFeatureSet")

    Try
        ::oSample   := Win_OleCreateObject(::cCLSID_Sample)
    catch lc_oError
    ::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPShrXLib_Shared_Build"+CRLF
    ::cErrorTxtReturn := "Instance IDPFPSample"+CRLF
    ::cErrorTxtReturn +=    "Error: "       + Transform(lc_oError:GenCodenil) + CRLF +;
                                "SubC: "            + Transform(lc_oError:SubCodenil) + CRLF +;
                                "OSCode: "      + Transform(lc_oError:OsCode,       nil) + CRLF +;
                                "SubSystem: "   + Transform(lc_oError:SubSystem,    nil) + CRLF +;
                                "Mensagem: "    + lc_oError:Description
        ::lErrorCatch := .T.
    End Try

    If ::lErrorCatch
        Return .F.
    EndIf
    //OBJECT_EXPLORER(::oSample, "IDPFPSample")

    Try
        ::oTemplate := Win_OleCreateObject(::cCLSID_Template)
    catch lc_oError
    ::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPShrXLib_Shared_Build"+CRLF
    ::cErrorTxtReturn := "Instance IDPFPTemplate"+CRLF
    ::cErrorTxtReturn +=    "Error: "       + Transform(lc_oError:GenCodenil) + CRLF +;
                                "SubC: "            + Transform(lc_oError:SubCodenil) + CRLF +;
                                "OSCode: "      + Transform(lc_oError:OsCode,       nil) + CRLF +;
                                "SubSystem: "   + Transform(lc_oError:SubSystem,    nil) + CRLF +;
                                "Mensagem: "    + lc_oError:Description
        ::lErrorCatch := .T.
    End Try

    If ::lErrorCatch
        Return .F.
    EndIf
    //OBJECT_EXPLORER(::oTemplate, "IDPFPTemplate")


Return .T.
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_UiSuport() Class DigPersonaEnrollment
    Local lc_oSelf := Hb_qSelf()
    Local lc_oBtn351_Confirmar
    Local Enroll
    DEFINE WINDOW ::oWndEnrollment from 0,0 to 484,520 TITLE "Capturar Digital" PIXEL
    /*
    DEFINE Dialog ::oDlgEnrollment Resource "ENROLLMENT2" //OF ::oWndEnrollment
        ::oDlgEnrollment:lTransparent := .F.
        //::oDlgEnrollment:nStyle := nOR(WS_CHILD,WS_CLIPCHILDREN)

        ::oActx391_EnrollmentControl := TActiveX():Redefine(391,lc_oSelf:oDlgEnrollment,::cCLSID_ActxEnrollmentControl)

        //::oActx391_EnrollmentControl := THActiveX():New(lc_oSelf:oWndEnrollment,::cCLSID_ActxEnrollmentControl,0,0,500,420)
        //::oActx391_EnrollmentControl := TActiveX():Redefine(391,lc_oSelf:oDlgEnrollment,::cCLSID_ActxEnrollmentControl)


        ::oDlgEnrollment:bInit := <||
            ::oActx391_EnrollmentControl:bOnEvent := { | f_event, f_aParams, f_pParams | lc_oSelf:DigPersonaEnrollment_Event( f_event, f_aParams, f_pParams ) }
            Return Nil
        >//cEnd

    ACTIVATE Dialog ::oDlgEnrollment CENTERED //NOMODAL
        */

        @ 440, 100 ButtonBmp Enroll ;
            size 120,60 Of ::oWndEnrollment BitMap Res_BmpName("CONFIRMAR") ;
            Prompt "Confirmar" PIXEL ;    
            TEXTRIGHT ;
            ToolTip "Confirma a Captura das digitais e finaliza"
         
            Enroll:bAction := <||
                Local _uVar := 0
                ::DigPersonaEnrollment_Confirmar()
                Return Nil
            > //cEnd

   
    ::oWndEnrollment:bInit := <||
        //::oDlgEnrollment:Move(0,0)
        ::oActx391_EnrollmentControl := THActiveX():New(lc_oSelf:oWndEnrollment,::cCLSID_ActxEnrollmentControl,0,0,500,420)
        //::oActx391_EnrollmentControl := THActiveX():New(lc_oSelf:oWndEnrollment,::cCLSID_VerificationControl,0,0,500,420)
        ::oActx391_EnrollmentControl:bOnEvent := <| f_event, f_aParams, f_pParams, f_Tst01, f_Tst02, f_Tst03 |
            lc_oSelf:DigPersonaEnrollment_Event( f_event, f_aParams, f_pParams)
            If ValType(f_Tst01) != "U"
                ? "01   "+ValType(f_Tst01)
            ElseIf ValType(f_Tst02) != "U"
                ? "02   "+ValType(f_Tst02)
            ElseIf ValType(f_Tst03) != "U"
                ? "03   "+ValType(f_Tst03)
            EndIf
            Return Nil
        > //cEnd
        //__objAddMethod(lc_oSelf:oActx391_EnrollmentControl,"OnComplete",@MyOnComplete())

    Return Nil
    > //cEnd

    ACTIVATE WINDOW ::oWndEnrollment NORMAL CENTERED

    //hb_MemoWrit(DIR_TEMP()+"_EventDigitalPersona.txt")
    //shellExecute(0,"open",DIR_TEMP()+"_EventDigitalPersona.txt")

Return Nil
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_Confirmar() Class DigPersonaEnrollment

    ? ::oFeatureExtraction:FeatureSet()

Return Nil
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_Capture() Class DigPersonaEnrollment
    Local lc_oDlgCapture
    Local lc_oBtn651_Capture
    Local lc_oBmp

    DEFINE DIALOG lc_oDlgCapture RESOURCE "DIGITAL_PERSONA_CAPTURE"


        Redefine ButtonBmp lc_oBtn651_Capture ;
            Id 651 Of lc_oDlgCapture BitMap "cBitmapRes";
            Prompt "Capturar" ;    
            CANCEL  ;
            TEXTRIGHT ;
            ToolTip "Teste"
         
            lc_oBtn651_Capture:bAction := <||
                Local _uVar := 1
                ::oCapture:StartCapture()
                syswait(5)
                Define Bitmap lc_oBmp
                lc_obmp := CreateCompatibleBitmap(GetDC( GetDesktopWindow()),200,200)
                ::oSample:Serialize()
                ? ::oSampleConversion:ConvertToPicture(@::oSample,lc_oBmp)
                ::oCapture:StopCapture()
                Return Nil
            > //cEnd

    ACTIVATE DIALOG lc_oDlgCapture CENTERED

Return Nil

 
User avatar
Giovany Vecchi
 
Posts: 223
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: How to call Events from OLE/COM objects

Postby Jimmy » Thu Apr 28, 2022 12:23 am

hi,

thx for Code ... a lot i have to learn about FiveWin

Question : where are those #DEFINE come from :?:

---

Xbase++ have a Tool call TLB2CH.EXE
when use CLSID or PROGID as Parameter it will show all #DEFINE of COM Interface

does FiveWin have a Tool like TLB2CH.EXE :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: How to call Events from OLE/COM objects

Postby Antonio Linares » Thu Apr 28, 2022 3:41 am

Dear Jimmy,

> does FiveWin have a Tool like TLB2CH.EXE

Yes, please review FWH\samples\olebrow.prg
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: How to call Events from OLE/COM objects

Postby Jimmy » Thu Apr 28, 2022 4:38 am

hi Antonio,
Antonio Linares wrote:Yes, please review FWH\samples\olebrow.prg

THX,

i try
Code: Select all  Expand view  RUN
build.bat olebrow

or
Code: Select all  Expand view  RUN
buildh.bat olebrow

but got "Unresolved external" :?
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: How to call Events from OLE/COM objects

Postby Antonio Linares » Thu Apr 28, 2022 1:41 pm

Jimmy,

What unresolved external you get ?

Please copy here the output
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: How to call Events from OLE/COM objects

Postby Maurizio » Thu Apr 28, 2022 1:58 pm

Jimmy,

did you check the path to the line 45 ?

#include "c:\harbour\contrib\hbwin\hbwinole.h"

Maurizio
User avatar
Maurizio
 
Posts: 825
Joined: Mon Oct 10, 2005 1:29 pm

Re: How to call Events from OLE/COM objects

Postby Giovany Vecchi » Thu Apr 28, 2022 2:32 pm

Look here at OLEBROW.EXE. In the example using DPFPActX.DPFPEnrollmentControl.1 only the functions and properties appear. EVENTS do not. In this case I have no idea how to parameterize/open/call these EVENTS etc.

Image
User avatar
Giovany Vecchi
 
Posts: 223
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: How to call Events from OLE/COM objects

Postby Jimmy » Sun May 15, 2022 12:47 am

hi,

sorry ... have "forgot" this Thread

have SET
Code: Select all  Expand view  RUN
set bcdir=c:\bcc7
set FWDIR=c:\fwh
set fwh=c:\fwh
set GT=gtgui
set HBDIR=c:\harbour
set hdir=c:\harbour
set hdirl=c:\harbour\lib\win\bcc


and Call

Code: Select all  Expand view  RUN
build.bat olebrow


and got

Turbo Incremental Link 6.70 Copyright (c) 1997-2014 Embarcadero Technologies, Inc.
Error: Unresolved external '_HB_FUN_REGOPENKEY' referenced from C:\FWH\SAMPLES\OLEBROW.OBJ
Error: Unresolved external '_HB_FUN_REGENUMKEY' referenced from C:\FWH\SAMPLES\OLEBROW.OBJ
Error: Unresolved external '_HB_FUN_REGQUERYVALUE' referenced from C:\FWH\SAMPLES\OLEBROW.OBJ
Error: Unresolved external '_HB_FUN_REGCLOSEKEY' referenced from C:\FWH\SAMPLES\OLEBROW.OBJ
Error: Unresolved external '_HB_FUN_XBROWSE' referenced from C:\FWH\SAMPLES\OLEBROW.OBJ
Error: Unresolved external '_HB_FUN_MSGYESNO' referenced from C:\FWH\SAMPLES\OLEBROW.OBJ
Error: Unresolved external '_HB_FUN_MSGALERT' referenced from C:\FWH\SAMPLES\OLEBROW.OBJ
Error: Unresolved external '_HB_FUN_TREG32' referenced from C:\FWH\SAMPLES\OLEBROW.OBJ
Error: Unresolved external '_HB_FUN_FW_GT' referenced from C:\FWH\SAMPLES\OLEBROW.OBJ
Error: Unable to perform link
* Linking errors *


using

Code: Select all  Expand view  RUN
buildH.bat olebrow


i got

Turbo Incremental Link 6.70 Copyright (c) 1997-2014 Embarcadero Technologies, Inc.
Error: Unresolved external '_HB_FUN_OCCURS' referenced from C:\FWH\LIB\FIVEH.LIB|VALTOSTR
Error: Unresolved external '_hb_strAtI' referenced from C:\FWH\LIB\FIVEH.LIB|VSTRFUN1
Error: Unresolved external '_HB_FUN_HB_BLEN' referenced from C:\FWH\LIB\FIVEH.LIB|OLEFUNCS
Error: Unresolved external '_HB_FUN___OLEVARIANTNEW' referenced from C:\FWH\LIB\FIVEH.LIB|ADOFUNCS
Error: Unresolved external '_hb_extIsNil' referenced from C:\FWH\LIB\FIVEHC.LIB|RICHEDIT
Error: Unresolved external '_HB_FUN_HB_TSTOUTC' referenced from C:\FWH\LIB\FIVEH.LIB|VALTOSTR
Error: Unable to perform link
* Linking errors *


---

did you check the path to the line 45 ?
#include "c:\harbour\contrib\hbwin\hbwinole.h"

i do have this in c:\fwh\samples\olebrow.prg
Code: Select all  Expand view  RUN
#pragma BEGINDUMP
#include <hbapi.h>
#include "c:\harbour\contrib\hbwin\hbwinole.h"


i still have Problem with FiveWin Environment ...
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: How to call Events from OLE/COM objects

Postby Antonio Linares » Sun May 15, 2022 8:04 am

Dear Jimmy,

Here you have it already built:
https://github.com/FiveTechSoft/FWH_tools/blob/master/olebrow.exe

We want to thank you for all the help you provide to these forums, so we want to gift you with the latest FWH version :-)

Please email me to alinares@fivetechsoft.com with your phone number and we will send a free FWH for you ;-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 52 guests