47

Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

  • Upload
    others

  • View
    16

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the
Page 2: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

Modification HistoryDate Author Modification DoneAugust 30, 2005 Fousiya Banu Changed the

GetCardHolderInfoByName() API.

Page 3: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

Table of Contents

Table of Contents................................................................................................2Introduction.........................................................................................................6Object Model........................................................................................................7Object Specifications..........................................................................................8AccessLevel..................................................................................................................8

Properties:...............................................................................................................................................8Account.........................................................................................................................8

Properties:...............................................................................................................................................8Methods:..................................................................................................................................................8

Init:.......................................................................................................................................................8GetAccessLevels:.................................................................................................................................9GetCardHolders:...................................................................................................................................9GetCardHolders_sync:.........................................................................................................................9GetEvents:............................................................................................................................................9GetNumCardHolders:...........................................................................................................................9SetAdditionalSearchCriteria_sync:....................................................................................................10

Application..................................................................................................................11Properties:.............................................................................................................................................11Properties:.............................................................................................................................................11Methods:................................................................................................................................................11

GetAccessLevels:...............................................................................................................................11GetAccounts:......................................................................................................................................11GetAccountByID:...............................................................................................................................12GetAllDevices:...................................................................................................................................12GetCardByID:.....................................................................................................................................12GetCardHolderByID:.........................................................................................................................12GetEvents:..........................................................................................................................................12GetHardwareByDeviceID:.................................................................................................................13GetHardwareByID:.............................................................................................................................13Login:.................................................................................................................................................13

Card.............................................................................................................................14Properties:.............................................................................................................................................14Methods:................................................................................................................................................15

GetEvents:..........................................................................................................................................15Init:.....................................................................................................................................................15Save:...................................................................................................................................................15GetAccessLevels:...............................................................................................................................15AddAccessLevel:................................................................................................................................16ClearAccessLevels:............................................................................................................................16DeleteByCardNumber........................................................................................................................16

CardHolder..................................................................................................................16Properties:.............................................................................................................................................16Methods:................................................................................................................................................17

GetCards:............................................................................................................................................17GetEvents:..........................................................................................................................................17Init:.....................................................................................................................................................17Save:...................................................................................................................................................17SetExpirationDateForAllCards:.........................................................................................................18GetPictures:........................................................................................................................................18GetSignatures:....................................................................................................................................18

Page 4: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

AddPhoto:...........................................................................................................................................18AddSignature:.....................................................................................................................................18GetNoteField:.....................................................................................................................................19SetNoteField:......................................................................................................................................19GetCardHolderInfoByName:.............................................................................................................19GetCardHolderInfoByCardNumber:..................................................................................................20GetPhotoNames:.................................................................................................................................20GetPhoto:............................................................................................................................................20GetSignatureNames:...........................................................................................................................20DeleteCardHolderByID......................................................................................................................21

CardHolderCallBackSetup.........................................................................................22Properties:.............................................................................................................................................22Properties:.............................................................................................................................................22Methods:................................................................................................................................................22

SetAdditionalSearchCriteria:..............................................................................................................22StopCallback:.....................................................................................................................................23

EventObj......................................................................................................................24Properties:.............................................................................................................................................24Properties:.............................................................................................................................................24get_EventData ( BSTR * _arg1 ):........................................................................................................24Methods:................................................................................................................................................25

GetEventCodeText:............................................................................................................................25GetTypeText:......................................................................................................................................25Init:.....................................................................................................................................................25

EventCallBackSetup...................................................................................................26Properties:.............................................................................................................................................26Properties:.............................................................................................................................................26Methods:................................................................................................................................................27

StopCallback:.....................................................................................................................................27Reset:..................................................................................................................................................28

HWIndependentDevice...............................................................................................29Properties:.............................................................................................................................................29Properties:.............................................................................................................................................29Methods:................................................................................................................................................29

GetEvents:..........................................................................................................................................29Init:.....................................................................................................................................................29

Operator......................................................................................................................31Properties:.............................................................................................................................................31Methods:................................................................................................................................................31

Init:.....................................................................................................................................................31Connection..................................................................................................................31

Methods:................................................................................................................................................31Enumerated Types used...................................................................................32AlarmType...................................................................................................................32EntranceDoorAjar........................................................................................................32EntranceDoorNormal....................................................................................................32EntranceForcedOpen....................................................................................................32EntranceTrouble...........................................................................................................32InputActive...................................................................................................................32InputDoorAjar..............................................................................................................32InputNormal.................................................................................................................32InputTrouble1...............................................................................................................32InputTrouble2...............................................................................................................32

Page 5: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

CardCodes..................................................................................................................32APBViolation.....................................................................................................................................32AreaNotEnabled.................................................................................................................................32BeforeActivation................................................................................................................................32CardNotFound....................................................................................................................................32Deactivated.........................................................................................................................................32DoorUnlocked....................................................................................................................................33Duress.................................................................................................................................................33EntranceAPBNotUsed........................................................................................................................33EntranceAPBUsed..............................................................................................................................33EntranceDuressNotUsed.....................................................................................................................33EntranceDuressUsed...........................................................................................................................33EntranceFCNotUsed...........................................................................................................................33EntranceFCUsed.................................................................................................................................33EntranceFormat..................................................................................................................................33EntranceFormatReversed...................................................................................................................33EntranceFullNotUsed.........................................................................................................................33EntranceFullUsed...............................................................................................................................33EntranceHostGrant.............................................................................................................................33EntranceHostGrantDownload.............................................................................................................33EntranceLocked..................................................................................................................................33EntranceNeverAllowed......................................................................................................................33ExpiredCard........................................................................................................................................33InvalidPIN..........................................................................................................................................33InvalidSiteCode..................................................................................................................................34InvalidTimezone.................................................................................................................................34IssueCode...........................................................................................................................................34NoSecondCard....................................................................................................................................34OccupancyLimit.................................................................................................................................34SiteCodeExtension.............................................................................................................................34UseLimit.............................................................................................................................................34TraceCard...........................................................................................................................................34ValidCard...........................................................................................................................................34

ComparisonType........................................................................................................34ctEquals..............................................................................................................................................34ctGreaterThan.....................................................................................................................................34ctGreaterThanEqual............................................................................................................................34ctLessThan..........................................................................................................................................34ctLessThanEqual................................................................................................................................34

EventType...................................................................................................................34HisAlarm............................................................................................................................................34HisAlarmAck......................................................................................................................................34HisAlarmClr.......................................................................................................................................34HisAlarmMessage..............................................................................................................................35HisCard...............................................................................................................................................35HisCardAck........................................................................................................................................35HisCardClr..........................................................................................................................................35HisCardMessage.................................................................................................................................35HisDatabase........................................................................................................................................35HisOperator........................................................................................................................................35HisSystem...........................................................................................................................................35HisSystemAlarm.................................................................................................................................35HisSystemAlarmAck..........................................................................................................................35HisSystemAlarmClr...........................................................................................................................35HisSystemAlarmMessage...................................................................................................................35

Page 6: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

Installation.........................................................................................................36Examples............................................................................................................36

Page 7: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

IntroductionThe success of the WIN-PAK access control product and the need to provide access to its database across multiple platforms has resulted in this database Application Program Interface (API). With this API, we have created a set of COM objects that provide the ability to read and write information to the WIN-PAK database. With this first release, the capabilities are limited to the most often used data. Navigation within the object model mimics the navigation common to Microsoft Word, Microsoft Excel, and other tools. You will have access to the following objects:

NCIWinPak.AccessLevel: Cards may have one (in WIN-PAK) or more(in WIN-PAK Pro) access levels assigned to them. This object contains the Access Level ID and the name assigned to it in WIN-PAK.

NCIWinPak.Account: Grants the user access to cardholders and account specific events/alarms. From this level, you also obtain the note field names and corresponding index names within a card holder record.

NCIWinPak.Application: Grants the user access to all accounts and events/alarms on all accounts and devices.

NCIWinPak.Card: Grants the user access to card specific events and alarms. You can also use this object to assign a card to cardholder in an account.

NCIWinPak.CardHolder: Grants the user access to cards and cardholder specific events and alarms. You can also use this interface to add a cardholder to an account.

NCIWinPak.CardHolderCallBackSetup: Provides the NCIWinPak.Account object with the cardholder information that should be returned and who should get it.

NCIWinPak.EventCallBackSetup: Provides the NCIWinPak.Account, NCIWinPak.Application, NCIWinPak.Card, NCIWinPak.CardHolder, and NCIWinPak.HWIndependentDevice objects with event information to be returned and who should get it.

NCIWinPak.EventObj: Contains the details relating to an event/alarm. From this object, you can find the card, cardholder, and device associated with the event. It is possible that no card or cardholder will be associated with an event (example: Forced Entry).

NCIWinPak.HWIndependentDevice: This object contains information about the item that generated an event. For card reads, this object will be used to identify the reader used to read the card.

NCIWinPak.Operator: Allows the COM objects and users of the COM objects to get all the benefits of the WIN-PAK operator level permissions outside of the WIN-PAK user interface. This includes standard WIN-PAK login capabilities.

Page 8: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

Object ModelThe following diagram depicts the relationships between the objects as well as paths available to navigate between the various objects.

All of the above boxes represent COM objects available from the system. (The diagram uses UML to express the relationships between objects.) A few of the objects not in this diagram, such as AccessLevel, can be obtained through the Application object. The diagram shows how to navigate between the major components of the dbAPI. For example, the one Application object allows navigation to:

Account (zero or more) Event (zero or more) A specific CardHolder A specific Card A specific HWIndependentDevice

Page 9: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

Object Specifications

AccessLevelProperties:|Property Name VB Type VC++ Type Description

ID Long long Uniquely identifies the entity to the application.

Description String bstrt The access level’s description.Properties :

get_Description ( BSTR * _arg1 ):Returns the access level description((Describes the access level)

get_ID (long * _arg1 ):Returns the ID of this access level(The access level's unique ID.)

AccountProperties:Property Name VB Type VC++ Type Description

ID Long long Uniquely identifies the entity to the application.

AccountName String BSTR The account’s name.MiscFields String() SAFEARRAY* You can add up to 10

miscellaneous pieces of data to an account. This is that data.

CardHolderFilterFieldNames String() SAFEARRAY* Returns the template field names that the user can use to filter cardholders.

Properties:get_ID ( long * _arg1 ) :

Returns the account's unique ID.get_AccountName ( BSTR * _arg1 ):

Returns the account's name.get_MiscFields ( SAFEARRAY * * _arg1 ):

Returns the data fields that the user sets via the Winpak UIget_CardHolderFilterFieldNames ( SAFEARRAY * * _arg1 ):

Returns the template field names that the user can use to filter cardholders.

Methods:Init:Method Name: Init

VB Signature: ( operatorObj As Object )VC++ Signature: ( Idispatch** operatorObj)Description: If you create the Account object, it is your responsibility to tell it which

operator is manipulating the Account. Failure to do so will cause it to throw COM exceptions

Page 10: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

whenever you try to view or set data within the object. If a NCIWinPak object returns an Account to you, you can assume that the Init has already been called for you.

Parameters: operatorObj: An initialized NCIWinPak.Operator object.

GetAccessLevels:Method Name: GetAccessLevels

VB Signature: ( ByRef accessLevels as variant )VC++ Signature: (VARIANT* accessLevels)Description: This method retrieves all the access levels that are available specifically to this account. The

GetAccessLevel function exposed by the Application object returns all access levels on the system regardless of their account. It is useful when you have only one account, but if you have multiple accounts with separate access levels it is possible to assign a card from one account an access level from another. The behavior of the system is undefined in that case.

Parameters:

GetCardHolders:Method Name: GetCardHolders

VB Signature: ( ByRef callbackSetup as Object )VC++ Signature: ( Idispatch** callbackSetup )Description: This asynchronous function returns all cardholders related to the account based

on the information specified in the callbackSetup argument. callbackSetup must be an instance of a CardHolderCallBackSetup object.

Parameters: callbackSetup: Specifies any search criteria for the cardholder retrieval.

GetCardHolders_sync:Method Name: GetCardHolders_sync

VB Signature: ( numItems as Long, cardHolders as Variant )VC++ Signature: ( long* numItems, VARIANT* cardHolders )Description: Returns the cardholders only when asked. On the first call it returns records

starting from the first record up to numItems records. Subsequent calls continue from the next position beyond the last return (i.e. if it returns 1-10 on the first call, call number 2 returns 11-20). This will not return more records than are available in the database. If you ask for 300 records and the database only has two left to return, you will only get two records.

Parameters: callbackSetup: Specifies any search criteria for the cardholder retrieval.

GetEvents:Method Name: GetEvents

VB Signature: ( ByRef callbackSetup as Object )VC++ Signature: ( Idispatch** callbackSetup)Description: This asynchronous function returns all events related to the account based on

the information specified in the callbackSetup argument. callbackSetup must be an instance of an EventCallBackSetup object.

Parameters: callbackSetup: Specifies any search criteria for the event retrieval.

GetNumCardHolders:Method Name: GetNumCardHolders

Page 11: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

VB Signature: as LongVC++ Signature: longDescription: Returns the number of cardholders associated with this account. If you want to

know the number based on some search settings (ex. FirstName < “M”) then you need to call SetAdditionalSearchCriteria_sync first.

SetAdditionalSearchCriteria_sync:Method Name: SetAdditionalSearchCriteria_sync

VB Signature: ( inputSearchFields() as String, fieldData() as String, comparisons() as ComparisonType )

VC++ Signature: ( SAFEARRAY** inputSearchFields, SAFEARRAY** fieldData, SAFEARRAY** comparisons )

Description: This function sets the cardholder lookup information for a synchronous cardholder callback. That is, the user will have to repeatedly call GetCardHolders_sync until all the card holders are retrieved or until the caller no longer wants more cardholders. The size of all three arrays must be the same, because there is a 1:1:1 correspondence at each index.

Parameters: inputSearchFields: Array of fields to search on. The field names should come from the

CardHolderFilterFieldNames property. fieldData: Data to perform the search against. comparisons: Using the ComparisonType data-type, this tells what type of comparison

you want to perform between the inputSearchFields(i) and fieldData(i). See ComparisonType in the enumerated types section for details.

Page 12: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

ApplicationProperties:Property Name VB Type VC++ Type DescriptionOperator Object _variant_t Used to identify the currently

logged in operator. Common usage dictates that you must login, create an Operator, and then set the Operator to the Application object before executing any methods.

IsPrecisionAccessLevels Boolean BOOL True indicates you can have only one access level per object, false indicates multiple are allowed. Use this function to determine whether you should set the AccessLevel property on a card or use the Card’s methods to manipulate the access levels (Multiple mode) See the Card object for more details.

Properties:get_Operator ( VARIANT * _arg1 ):

Returns the operator logged into the applicationput_Operator ( VARIANT * _arg1 )

Sets the application's operator.get_isPrecisionAccessLevels ( VARIANT_BOOL * _arg1 )

used to tell you whether or not the winpak system is set to precision or multiple access levels. This affects how the card object functions

Methods:

GetAccessLevels:Method Name: GetAccessLevels

VB Signature: (accessLevels as Variant )VC++ Signature: ( VARIANT* accessLevels )Description: Returns all access levels available from the WIN-PAK installation. Parameters:

accessLevels: On return this contains an array of AccessLevel objects containing the access level description and ID. NOTE – this array includes all access levels for ALL accounts. If you have more than one account call the method GetAccessLevels on the account object.

GetAccounts:Method Name: GetAccounts

VB Signature: ( ByRef accounts as Variant )VC++ Signature: ( VARIANT* accounts )Description: Returns all the accounts registered with this WIN-PAK installation. Parameters:

accounts: Contains all the accounts within this installation.

Page 13: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

GetAccountByID:Method Name: GetAccountByID

VB Signature: (ByVal ID as Long, ByRef anAccount as Variant)VC++ Signature: ( long ID, VARIANT* anAccount )Description: Returns the Account by its ID.Parameters:

ID: Uniquely identifies the Account to retrieve. anAccount: On return, this will be set to an Account object.

GetAllDevices:Method Name: GetAllDevices

VB Signature: (devices as Variant)VC++ Signature: (VARIANT* devices )Description: Returns all the devices setup on the system.Parameters:

devices: An array of HWIndependentDevice objects.

GetCardByID:Method Name: GetCardByID

VB Signature: (ByVal ID as Long, ByRef aCard as Variant)VC++ Signature: ( long ID, VARIANT* aCard )Description: Returns the Card by its ID.Parameters:

ID: Uniquely identifies the Card to retrieve. aCard: On return, this will be set to a Card object.

GetCardHolderByID:Method Name: GetCardHolderByID

VB Signature: (ByVal ID as Long, ByRef aCardHolder as Variant)VC++ Signature: ( long ID, VARIANT* aCardHolder)Description: Returns the CardHolder by its ID.Parameters:

ID: Uniquely identifies the CardHolder to retrieve. aCardHolder: On return, this will be set to a CardHolder object.

GetEvents:Method Name: GetEvents

VB Signature: ( ByRef callbackSetup as Object)VC++ Signature: ( Idispatch** callbackSetup)Description: This asynchronous function returns all events related to the account based on

the information specified in the callbackSetup argument. callbackSetup must be an instance of an EventCallBackSetup object.

Parameters: callbackSetup: Specifies any search criteria for the event retrieval.

GetHardwareByDeviceID:Method Name: GetHardwareByDeviceID

Page 14: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

VB Signature: (ByVal deviceID as Long, ByRef hardwareDevice as Variant)VC++ Signature: ( long deviceID, VARIANT* hardwareDevice )Description: Returns the HWIndependentDevice by its device ID.Parameters:

deviceID: One of two ways to uniquely identify a piece of hardware. hardwareDevice: On return, this will be set to a HWIndependentDevice object.

GetHardwareByID:Method Name: GetHardwareByID

VB Signature: (ByVal ID as Long, ByRef hardwareDevice as Variant)VC++ Signature: ( long ID, VARIANT* hardwareDevice )Description: Returns the HWIndependentDevice by its ID.Parameters:

ID: One of two ways to uniquely identify a piece of hardware. hardwareDevice: On return, this will be set to a HWIndependentDevice object.

Login:Method Name: Login

VB Signature: (userID as Long, Optional userName as String = “”, Optional password As String = “”, Optional domainName As String = “”)

VC++ Signature: ( long* userID, BSTR* userName, BSTR* password, BSTR* domainName)Description: Performs a normal, WIN-PAK login through the database server. This method

allows the caller to use WIN-PAK’s NT authentication if NT authentication has been enabled through the System Settings dialog in WIN-PAK. When using NT authentication, you can allow the current user to login without getting their userName and password—the system knows how to extract the user’s SID (security ID) and find out if they are in the WIN-PAK group. For information on using NT integrated security, see the WIN-PAK user manual.

Parameters: userID: If the user successfully log in this contains a value greater than 0. The number

identifies the currently logged in user. Pass this value to the Operator.Init method. userName: Identifies the name WIN-PAK knows the user by. password: The plaintext password the user typed in. domainName: If the system uses NT security, identifies the domain (or machine if using

an NT workgroup) the user belongs to. This is not needed if the system only has one user by the name given in userName. Ex. You only need domainName if you have users server1\bob and server2\bob in the WIN-PAK group.

Page 15: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

CardProperties:Property Name VB Type VC++ Type DescriptionID Long Long Uniquely identifies the entity

to the application.CardNumber String _bstr_t The string that identifies the

card.ActivationDate Date DATE The date that the card was

activated.ExpirationDate Date DATE The date that the card will

expire.AccountID Long Long Identifies which account the

card belongs to.CardHolderID Long Long Identifies which cardholder the

card belongs to.AccessLevel Long _variant_t Identifies which access levels

the card is associated with.CardStatus Long Long Identifies the status of a card

Properties:get_ID ( long * _arg1 ):

Returns the number that uniquely identifies the card.get_CardNumber( BSTR * _arg1 ):

Returns the number that the panel uses to identify the card.put_CardNumber ( BSTR * _arg1 ):

Sets the card number.get_AccessLevel ( long * _arg1 ):

Returns the access levels that were assigned to the card at the time it was loaded.put_AccessLevel ( long * _arg1 ):

Sets the access levels for the card.get_ActivationDate ( DATE * _arg1 ):

Returns the Date to activate the cardput_ActivationDate ( DATE * _arg1 )

Sets the activation date for the card.get_ExpirationDate ( DATE * _arg1 ):

Returns the Date to expire the cardput_ExpirationDate ( DATE * _arg1 ):

Sets the expiration date for the card.get_AccountID ( long * _arg1 ):

Gets the account ID.put_AccountID ( long * _arg1 )

Sets the account the card is associated with.get_CardHolderID ( long * _arg1 )

Returns the ID of the related card holder.put_CardHolderID ( long * _arg1 ):

Sets the ID of the associated cardholder.get_cardStatus ( enum CARD_STATUS * _arg1 ):

Returns the CardStatus put_cardStatus ( enum CARD_STATUS * _arg1 )

Sets the CardStatus

Page 16: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

Where CARD_STATUS is defined as enum CARD_STATUS{ Active = 1, Inactive = 2, LostOrStolen = 3, Trace = 4};

Methods:Note – if your system is configured to precision, assign the cards access level to the Property AccessLevelID. If the system is configured to allow multiple access levels per card, use the methods GetAccessLevels, ClearAccessLevels, and AddAccessLevel to modify the cards access levels.

GetEvents:Method Name: GetEvents

VB Signature: ( ByRef callbackSetup as Object)VC++ Signature: ( IDispatch** callbackSetup)Description: This asynchronous function returns all events related to the account based on

the information specified in the callbackSetup argument. callbackSetup must be an instance of an EventCallBackSetup object.

Parameters: callbackSetup: Specifies any search criteria for the event retrieval.

Init:Method Name: Init

VB Signature: ( operatorObj As Object )VC++ Signature: ( IDispatch** operatorObj)Description: If you create the Card object, it is your responsibility to tell it which operator is

manipulating the Card. Failure to do so will cause it to throw COM exceptions whenever you try to view or set data within the object. If an NCIWinPak object returns a Card to you, you can assume that the Init has already been called for you.

Parameters: operatorObj: An initialized NCIWinPak.Operator object.

Save:Method Name: Save

VB Signature: no parametersVC++ Signature: no parametersDescription: Saves a card and its changes. If this is a new card, you must minimally set the

AccountID and CardHolderID.The same function can be used to edit an existing card

GetAccessLevels:Method Name: GetAccessLevels

VB Signature: (ByRef variant)VC++ Signature: (VARIANT* )Description: This function only works when the system is set to multiple access levels. If that is

true the function will return a list of AccessLevel objects within the variant, one for each access level assigned to the card. Please note that this function only returns those that have been saved, it does not reflect the changes you have made to the card before it was saved.

Parameters:

Page 17: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

AddAccessLevel:Method Name: AddAccessLevel

VB Signature: (ByRef accessLevelID as Long)VC++ Signature: (Long* accessLevelID)Description: This function only works when the system is set to multiple access levels. If that is

true the function will add the access level specified by the AccessLevelID . The access level is not added until the card’s save method is called.

Parameters:

ClearAccessLevels:Method Name: ClearAccessLevels

VB Signature: ()VC++ Signature: ()Description: This function only works when the system is set to multiple access levels. If that is

true the function will remove all access levels from the card. The function is usually used in conjuction with calls to AddAccessLevels, to first clear the cards access levels then add all the access levels specified. NOTE – unlike the winpak user interface the db api will not stop you from assigning no access levels to a card and then saving it. The behavior of the system if you do that is undefined.

Parameters:

DeleteByCardNumberMethodName : DeleteByCardNumberVB Signature : ( CardNumber as String)VC++ Signature : (BSTR CardNumber )Description :

This function is used to delete an already existing card.

CardHolderProperties:Property Name VB Type VC++ Type DescriptionID Long long Uniquely identifies the entity to the

application.FirstName String BSTR Cardholder’s first name.LastName String BSTR Cardholder’s last name.NoteFields String() BSTR[] A WIN-PAK user can define up to

40 user defined fields. In the future, this limit will be removed and we will allow more (or fewer) fields as the user decides. These arrays will be passed around as SAFEARRAYs. Always ask for the UBound of the value before iterating over the entries in the array.

AccountID Long long Identifies which account the cardholder belongs to.

Properties:get_ID ( long * _arg1 ):

Retrieves the unique ID of this cardholder.get_FirstName ( BSTR * _arg1 ):

Returns the cardholder's first nameput_FirstName ( BSTR * _arg1 ):

Page 18: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

Sets the cardholder's first name.

get_LastName ( BSTR * _arg1 ):Returns the cardholder's last name

put_LastName ( BSTR * _arg1 ):Sets the cardholder's last name.

get_NoteFields ( SAFEARRAY * * _arg1 ):Returns all the note(aka template) fields to the caller.

get_AccountID ( long * _arg1 ):Returns the ID of the account associated with the cardholder.

put_AccountID ( long * _arg1 ):Sets the account associated with the cardholder.

Methods:

GetCards:Method Name: GetCards

VB Signature: ( ByRef cards as Variant )VC++ Signature: ( VARIANT* cards )Description: Returns all cards related to the cardholder.Parameters:

cards: This returns all cards associated with the cardholder.

GetEvents:Method Name: GetEvents

VB Signature: ( ByRef callbackSetup as Object )VC++ Signature: ( IDispatch** callbackSetup)Description: This asynchronous function returns all events related to the account based on

the information specified in the callbackSetup argument. callbackSetup must be an instance of an EventCallBackSetup object.

Parameters: callbackSetup: Specifies any search criteria for the event retrieval.

Init:Method Name: Init

VB Signature: ( operatorObj As Object )VC++ Signature: (IDispatch** operatorObj)Description: If you create the CardHolder object, it is your responsibility to tell it which

operator is manipulating the CardHolder. Failure to do so will cause it to throw COM exceptions whenever you try to view or set data within the object. If a NCIWinPak object returns a CardHolder to you, you can assume that the Init has already been called for you.

Parameters: operatorObj: An initialized NCIWinPak.Operator object.

Save:Method Name: Save

VB Signature: no parametersVC++ Signature: no parametersDescription: Saves a cardholder and its changes. If this is a new cardholder, you must set the

AccountID.

Page 19: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

SetExpirationDateForAllCards:Method Name: SetExpirationDateForAllCards

VB Signature: ( ByVal expDate As Date )VC++ Signature: ( DATE expDate )Description: Provides a method to set the expiration date for all cards owned by a

cardholder.Parameters:

expDate: The date to expire all of the cardholder’s cards.

GetPictures:Method Name: GetPictures

VB Signature: ( pictures As Variant )VC++ Signature: ( VARIANT* pictures )Description: Returns all of the pictures associated with a given cardholder. If a site has

many pictures for each cardholder this method could eat up a lot of memory quickly. Each picture is returned as an array of bytes. The sample VB program writes the bytes to a temp file and then loads the file into a Picture or Image control.

Parameters: pictures: An array of arrays of bytes. Each byte array contains a JPEG file as it was

loaded into memory (i.e. raw bytes, not a decoded image).

GetSignatures:Method Name: GetSignatures

VB Signature: ( signatures As Variant )VC++ Signature: ( VARIANT* signatures)Description: Returns all of the signatures associated with a given cardholder. If a site has

many signatures for each cardholder this method could eat up a lot of memory quickly. Each signature is returned as an array of bytes. The sample VB program writes the bytes to a temp file and then loads the file into a Picture or Image control.

Parameters: signatures: An array of arrays of bytes. Each byte array contains a WMF (Windows

metafile) file as it was loaded into memory (i.e. raw bytes, not a decoded image).

AddPhoto:Method Name: AddPhoto

VB Signature: ( thePhoto As Variant )VC++ Signature: ( VARIANT* thePhoto )Description: Provides a way to import photos into WIN-PAK. The bytes contained in

thePhoto must be the raw bytes of a JPEG file (as it would be stored on disk). If thePhoto is not a JPEG, the function throws a COM exception.

Parameters: thePhoto: The file loaded as a byte array (VT_ARRAY | VT_UI1 (C safearray or Byte()

in VB).

AddSignature:Method Name: AddSignature

VB Signature: ( theSignature As Variant )VC++ Signature: ( VARIANT* theSignature )Description: Provides a way to import signatures into WIN-PAK. The bytes contained in

theSignature must be the raw bytes of a WMF file (as it would be stored on disk). Parameters:

Page 20: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

theSignature: The file loaded as a byte array (VT_ARRAY | VT_UI1 (C safearray or Byte() in VB).

GetNoteField:Method Name: GetNoteField

VB Signature: ( fieldName As String ) As StringVC++ Signature: _bstr_t ( BSTR* fieldName )Description: Retrieves a NoteField by the name used to identify the field within the WIN-

PAK notefield template tab(s). You can retrieve the NoteField names from the appropriate Account instance.

Parameters: fieldName: Name of the field as known to the Account object.

SetNoteField:Method Name: SetNoteField

VB Signature: ( fieldName As String, value As String )VC++ Signature: ( BSTR* theSignature, BSTR* value )Description: Sets a NoteField by the name used to identify the field within the WIN-PAK

notefield template tab(s). You can retrieve the NoteField names from the appropriate Account instance.

Parameters: fieldName: Name of the field as known to the Account object. value: The new value for the named fieldName.

GetCardHolderInfoByName:Method Name: GetCardHolderInfoByName

VB Signature: Public Function GetCardHolderInfoByName (nNameSelect As Integer, sName As String, ByRef vCard As Variant, ByRef vCardHolder As Variant) as Boolean

VC++ Signature: bool GetCardHolderInfoByName ([in] int nNameSelect,[in]BSTR sName , [out,retval]VARIANT *vCard,[out,retval]VARIANT *vCardHolder )

Description: This asynchronous function gets the cardholder name as input and returns the card being held by the cardholder and all the details of the card holder.There can be many cardholders with the same name and hence this function returns all the card holder with the name given as input and the card being used by those card holders.

Parameters: 1) nNameSelect :

This parameter is used to identify the kind of the name.The user can give only the first name or last name or both or any part of thecard holder name as input .nNameSelect = 0 ,the name given as input is only first namenNameSelect = 1 ,the name given as input is only last namenNameSelect = 2 ,both the first and last name is given as input

Note:When nNameSelect is 2 , then the first name must be tagged as < FName>xxxx</FName>And last name must be tagged as <LName>yyyy</LName>

nNameSelect = 3 ,the name represents either first name or last name

2) sName :sName holds the name of the cardholder

Page 21: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

3) vCard :vCard is an output parameter that will contain the cards being used by the

cardholder.

4) vCardHolder :vCardHolder contains either a single cardholder or an array of cardholders who

all have their name satisfied with the sName given as input

Return Values:Boolean: - returns true if sName contains a valid cardholder name else returns false

Note:When nNameSelect is 2 , then the first name must be tagged as < FName>xxxx</FName>

and last name must be tagged as <LName>yyyy</LName>

GetCardHolderInfoByCardNumber:Method Name: GetCardHolderInfoByCardNumber

VB Signature: (sCardNum As String, vCard As Variant, vCardHolder As Variant) As Boolean VC++ Signature: (BSTR sCardNum,VARIANT* vCard ,VARIANT* vCardHolder )Description: This function is used to get the details of the cardholder when the cardnumber

is passed as the input.Parameters:

1)sCardNum:sCardNum holds the card number in the form of string.

2) vCard :vCard is an output parameter that holds the card information for the given card

number3)vCardHolder:

vCardHolder holds the CardHolder information of the card having the card number as the sCardNum given as input

GetPhotoNames:Method Name : GetPhotoNames

VB Signature : (CardHolderID As Long, thePhotoNames As Variant)VC++ Signature: (long* CardHolderID, VARIANT* thePhotoNames)Description: Returns all the photos assigned for a cardholderParamters:

1)CardHolderID - ID of the cardholder2)thePathnames – PathName of the Image file assigned to the cardholder

When there are more images assigned, then thePathNames contains an array of image pathnames assigned to the cardholder

GetPhoto:Method Name : GetPhoto

VB Signature : (PhotoName As String, thePhoto As Variant)VC++ Signature: (BSTR* PhotoName, VARIANT* thePhoto)

Page 22: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

Description : Returns the image file as a variant when image path name is passed as input.

Parameters:1)PhotoName : Name of the image2)thePhoto : Image in variant

GetSignatureNames:Method Name : GetSignatureNames

VB Signature: (CardHolderID As Long, theSignatureNames As Variant) VC++ Signature: (long* CardHolderID, VARIANT* theSignatureNames)Description: Path name of all signatures assigned to a cardholder

Parameters:1) CardHolderID – ID of CardHolder2)theSignatureNames – Path Name of signature file assigned to the cardholder

When the number of signatures assigned to a cardholder is more than one then all the signature names are enumerated

DeleteCardHolderByIDMethod Name : DeleteCardHolderByID

VB Signature: (AccountID As Long, CardHolderID As Long, bDelCard As Boolean, bDelPictures As Boolean)

VC++ Signature: (long* AccountID, long* CardHolderID, VARIANT_BOOL* bDelCard, VARIANT_BOOL* bDelPictures)

Description: This function is used to delete a cardholder Parameters:

1) AccountID : AccountID of the CardHolder

2) CardHolderID: Unique identifier of the cardholder

3) bDelCard : When bDelcard is set to- True; then all cards attached to the Cardholder will be deleted- False; then all cards attached to the cardholder will be detached but will not be deleted

4) bDelPictures: When bDelPictures is set to - True; then the images and signatures attached to the cardholder will be deleted- False; then the images and signatures attached to the cardholder will be detached but not

deleted.

Page 23: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

CardHolderCallBackSetupProperties:Property Name VB

TypeVC++ Type Description

ObjectsRequested Long long Caller fills this in to indicate how many objects they want to retrieve at a time. Set this to –1 to get all available objects. (–1 is the default value.)

CallBackObject Variant VARIANT When records are ready, this object gets them. This object must implement IDispatch so that the proper function names can be located and called. This must follow the setup defined by the NCICallBackObject. If you are using synchronous callbacks, this may be an empty variant.

theOperator Object IDispatchPtr Assigns or retrieves the currently logged in operator to the object.

AccountID Long long Identifies the account to retrieve cardholders from.Properties:

get_theOperator ( IDispatch * * _arg1 ):Returns the Operator object.

put_theOperator ( IDispatch * * _arg1 ):Used to associate an operator with the callback. This allows the callback to return objects with appropriately set usage permissions, based on the logged in Operator

get_ObjectsRequested ( long * _arg1 ):Returns the number of objects to return in each callback response

put_ObjectsRequested ( long * _arg1 ):Sets the number of objects to return in each call to the callback's SetData function.

get_AccountID ( long * _arg1 ):Returns the account to retrieve cardholders from.

put_AccountID ( long * _arg1 ):Sets the account to retrieve cardholders from.

get_CallBackObject (IDispatch * * _arg1 ):Returns the user provided callback object.

put_CallBackObject ( IDispatch * * _arg1 ):Sets the user provided callback object.

Methods:

SetAdditionalSearchCriteria:Method Name: SetAdditionalSearchCriteria

VB Signature: ( inputSearchFields() As String, fieldData() As String, comparisons() as ComparisonType )

VC++ Signature: ( SAFEARRAY** inputSearchFields, SAFEARRAY** fieldData, SAFEARRAY** comparisons )

Description: Allows you to specify additional criteria when looking up cardholders. This allows searching on FirstName, LastName, and any of the other fields returned by Account.CardHolderFilterFieldNames.

Parameters: inputSearchFields: Array of fields to search on. The field names should come from the

CardHolderFilterFieldNames property. fieldData: Data to perform the search against.

Page 24: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

comparisons: Using the ComparisonType data-type, this tells what type of comparison you want to perform between the inputSearchFields(i) and fieldData(i). See ComparisonType in the enumerated types section for details.

StopCallback:Method Name: StopCallback

VB Signature: no parametersVC++ Signature: no parametersDescription: If you want to terminate the processing of the cardholder callback for any

reason, call this function. You may want to do this if you no longer want cardholders to be returned.

Page 25: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

EventObjProperties:Property Name VB Type VC++ Type DescriptionCardHolderFirstName String _bstr_t The related cardholder’s first

name. You can also obtain this information from the relatedCardHolder.

CardHolderLastName String _bstr_t The related cardholder’s last name. You can also obtain this information from the relatedCardHolder.

GenTime Date DATE Time that the history record was created.

HWDeviceName String _bstr_t The name of the hardware device involved in the event.

ID Long long Uniquely identifies the entity to the application.

InternalDescription String _bstr_tReceiveTime Date DATE Time that the history record

was received.relatedCard Variant _variant_t Returns the related Card object

if one exists.relatedCardHolder Variant _variant_t Returns the related

CardHolder object if one exists.

relatedHWIndependentDevice Variant _variant_t Returns the related HWIndependentDevice object if one exists.

SequenceID Long long Identifies the sequence ID of the event.

Properties:get_EventData ( BSTR * _arg1 ):get_CardholderAccountID ( long * _arg1 ):get_operatorName ( BSTR * _arg1 ):

Returns the name of the operator, if any, related to this event.get_HWDeviceName ( BSTR * _arg1 ):get_CardHolderFirstName ( BSTR * _arg1 ):get_CardHolderLastName (BSTR * _arg1 ):get_SequenceID ( long * _arg1 ):get_ID ( long * _arg1 ):

Returns the event's unique ID.get_InternalDescription ( BSTR * _arg1 ):get_ReceiveTime ( DATE * _arg1 ):

Returns the time that the event was received by the communication server.get_GenTime (DATE * _arg1 ):

Returns the time that the event was first detected by a device.get_relatedCardHolder ( VARIANT * _arg1 ):

Returns the CardHolder object (if any) associated with the event.get_relatedCard ( VARIANT * _arg1 ):

Returns the Card object (if any) associated with the eventget_relatedHWIndependentDevice ( VARIANT * _arg1 ):

Returns the HWIndependentDevice object (if any) associated with the event

Page 26: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

Methods:

GetEventCodeText:Method Name: GetEventCodeText

VB Signature: ( ByVal language as String, ByRef codeText as String )VC++ Signature: ( BSTR language, BSTR* codeText )Description: The event code as text (English only)—This should eventually become a lookup

where user requests code in LanguageX and the object gives back the string in that language.

Parameters: language: At this point in time, the object only supports an English translation of the

event code. This language code corresponds to the standard language codes one can create using the MAKELANGID macro in C.

codeText: On return, this will contain the text in the language of your choice.

GetTypeText:Method Name: GetEventCodeText

VB Signature: ( ByVal language as String, ByRef codeText as String )VC++ Signature: ( BSTR language, BSTR* codeText )Description: The event code as text (English only)—This should eventually become a lookup

where user requests code in LanguageX and the object gives back the string in that language.

Parameters: language: At this point in time, the object only supports an English translation of the

event code. This language code corresponds to the standard language codes one can create using the MAKELANGID macro in C.

codeText: On return, this will contain the text in the language of your choice.

Init:Method Name: Init

VB Signature: ( operatorObj As Object )VC++ Signature: ( IDispatch** operatorObj)Description: If you create the EventObj object, it is your responsibility to tell it which

operator is manipulating the EventObj. Failure to do so will cause it to throw COM exceptions whenever you try to view or set data within the object. If a NCIWinPak object returns an EventObj to you, you can assume that the Init has already been called for you.

Parameters: operatorObj: An initialized NCIWinPak.Operator object.

Page 27: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

EventCallBackSetupProperties:Property Name VB Type VC++ Type DescriptionalarmPointID Long long Set this value to the ID of a specific alarm point

to get events related to that point.CallBackObject Variant IDispatch* When records are ready, this object gets them.

This object must implement IDispatch so that the proper function names can be located and called. This must follow the setup defined by the NCICallBackObject. If you are using synchronous callbacks, this may be an empty variant.

cardNumber String _bstr_t Set this value to search for events related to a specific card.

EndDate Date DATE Specifies the date and time of the next record to retrieve. The object will not look at this value once the object is passed to a GetEvents method. (Unless you call Reset()).

EventTypes EventType() SAFEARRAY Used to set the event types to return. If this member is not set, all event types are returned.

firstName String _bstr_t Set this value to search for events related to cardholders with a specific first name.

lastName String _bstr_t Set this value to search for events related to cardholders with a specific last name.

ObjectsRequested Long long Caller fills this in to indicate how many objects they want to retrieve at a time. Set this to –1 to get all available objects. (–1 is the default value.)

readerID Long long Set this value to search for events related to a specific card reader.

SortOnSequenceID Boolean BOOL Defaults to false. Set this value to true if you want the events returned in SequenceID order.

StartDate Date DATE Specifies the date and time of the first record to retrieve. The object will not look at this value once the object is passed to a GetEvents method. (Unless you call Reset()).

theAlarmCodes AlarmType () SAFEARRAY Used to set the alarm types to return. If this member is not set, all alarm types are returned.

theOperator Object VARIANT Assigns or retrieves the currently logged in operator to the object.

Properties:get_theOperator (IDispatch * * _arg1 ):

Returns the Operator object.put_theOperator ( IDispatch * * _arg1 ):

Used to associate an operator with the callback.get_ObjectsRequested ( long * _arg1 )::

Returns the number of objects to return in each callback response.get_StartDate ( DATE * _arg1 ):

Returns the earliest date the user wants to see when retrieving events.get_EndDate ( DATE * _arg1 ):

Returns the latest date the user wants to see when retrieving events.get_CallBackObject ( IDispatch * * _arg1 ):

Page 28: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

Returns the user provided callback object.get_NumEventTypes ( long * _arg1 ):

Returns the number of event types.put_ObjectsRequested ( long * _arg1 ):

Sets the number of objects to return in each call to the callback's SetData function.put_StartDate (DATE * _arg1 ):

Sets the earliest date to get events from.put_EndDate ( DATE * _arg1 ):

Sets the last date to get events from.put_CallBackObject ( IDispatch * * _arg1 ):

Sets the user provided callback object.put_EventTypes (SAFEARRAY * * _arg1 ):

Sets the types of events that you want the callback to return.put_theLookupType ( enum LookupType * _arg1 ):get_theLookupType ( enum LookupType * _arg1 )get_Identifier (long * _arg1 ):

Used to get the ID of the object to get events for. put_Identifier ( long * _arg1 ):

Used to put the ID of the object to get events for.get_StartTime ( DATE * _arg1 ):

Returns the earliest time the user wants to see when retrieving events for any given day.get_EndTime ( DATE * _arg1 ):

Returns the latest time the user wants to see when retrieving events for any given day.put_theCardCodes ( VARIANT * _arg1 ):

Used to define some filter criteria on card specific events.put_SortOnSequenceID ( VARIANT_BOOL * _arg1 ):

Tells us whether or not the caller wants the events sorted on the sequence ID.put_FirstName ( BSTR * _arg1 ):

Sets what the first name should look like.put_LastName ( BSTR * _arg1 ):

Sets what the last name should look like.put_CardNumber ( BSTR * _arg1 ):

The events must match the given card numberput_readerID (long * _arg1 ):

Sets the ID of the reader the events should have occured on.put_alarmPointID ( long * _arg1 ):

Sets the ID of the device for the alarm point.put_theAlarmCodes ( VARIANT * _arg1 ):

Sets the alarmCodes

Methods:

StopCallback:Method Name: StopCallback

VB Signature: no parametersVC++ Signature: no parametersDescription: If you want to terminate the processing of the event callback for any reason,

call this function. You may do this if you no longer want events to be returned.

Reset:Method Name: Reset

Page 29: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

VB Signature: no parametersVC++ Signature: no parametersDescription: Re-queries the data and moves the initial recordset pointer to the start.

Page 30: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

HWIndependentDeviceProperties:Property Name VB Type VC++ Type DescriptionName String _bstr_t Gives the device’s name.DeviceType Long long Value giving the device’s type.Description String _bstr_t Setup in WIN-PAK to describe the device in more

detail than just the name.ID Long long Uniquely identifies the entity to the applicationDeviceID Long long Uniquely identifies the device to the application. (Yes,

a HWIndependentDevice has two unique IDs.)

Properties:get_Name ( BSTR * _arg1 ):

Returns the device's name.get_DeviceType ( long * _arg1 ):

Returns the type of device.get_Description ( BSTR * _arg1 ):

Returns the device's description.get_ID (long * _arg1 ):

Returns the device's unique ID.get_DeviceID ( long * _arg1 ):

Maps the abstract device back to its real device.

Note : Use get_ID() property to get the HID of a device. The obtained HID can then be used to get the hierarchy of the HID bypassing the HID value to GetDeviceIdentificationByHWID() . For more details of GetDeviceIdentificationByHWID refer CommServerAPI.doc.

Use get_DeviceID() property to get the real Device ID. The obtained DeviceID can then be used to get the detailed information of the device by passing the DeviceID to GetDeviceDatils(). For more details of GetDeviceDetails refer CommServerAPI.doc

Methods:

GetEvents:Method Name: GetEvents

VB Signature: ( ByRef callbackSetup as Variant )VC++ Signature: ( IDispatch** callbackSetup)Description: This asynchronous function returns all events related to the account based on

the information specified in the callbackSetup argument. callbackSetup must be an instance of an EventCallBackSetup object.

Parameters: callbackSetup: Specifies any search criteria for the event retrieval.

Init:Method Name: Init

VB Signature: ( operatorObj As Object )VC++ Signature: (IDispatch** operatorObj)Description: If you create the HWIndependentDevice object, it is your responsibility to tell

it which operator is manipulating the HWIndependentDevice. Failure to do so will cause it to throw COM exceptions whenever you try to view or set data within the object. If a

Page 31: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

NCIWinPak object returns an HWIndependentDevice to you, you can assume that the Init has already been called for you.

Parameters: operatorObj: An initialized NCIWinPak.Operator object.

Page 32: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

OperatorProperties:Property Name VB Type VC++ Type DescriptionoperatorName String _bstr_t Gives the operator’s name.operatorDomain String _bstr_t Gives the operator’s domain name.accounts Variant _variant_t Array of longs that are the IDs of accounts the operator

has access to.

Methods:Init:Method Name: Init

VB Signature: ( operatorID as Long )VC++ Signature: ( long* operatorID)Description: Given an operator ID, loads up all the permissions and other data related to the

operator.Parameters:

operatorID: The operator’s ID as returned from a call to NCIWinPak.Login.

ConnectionMethods:Method Name : GetWPDSN

VB Signature : Public Function GetWPDSN() As String VC++ Signature: HRESULT GetWPDSN([out, retval] BSTR* );

Input : NoneOutput : String containing the DSN Description : GetWPDSN returns the Winpak Database Server DSN string.

Sample Output:<ServerName>ie10dt2kc02449</ServerName><Database>WIN-PAK PRO</Database><dsn>WIN-PAK Database</dsn><user>sa</user><password></password>

Page 33: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

Enumerated Types used

AlarmTypeThese values are used when filtering alarm-specific events.

EntranceDoorAjarDoor is stuck open.

EntranceDoorNormal The entrance is functioning normally.

EntranceForcedOpenSomething forced the door open.

EntranceTroubleSomething is wrong at an entrance.

InputActive A alarm was triggered by an input point.

InputDoorAjarDoor is stuck open.

InputNormalA check of an input point indicated everything is working.

InputTrouble1Input trouble, type 1. Usually, you will combine this with InputTrouble2 when querying history.

InputTrouble2Input trouble, type 2. Usually, you will combine this with InputTrouble1 when querying history.

CardCodesThese identify the various event types one can see related to a card event.

APBViolationAnti-passback violation.

AreaNotEnabled???

BeforeActivationCard was found but has not been activated yet.

CardNotFoundCard was not found in the card database.

Deactivated???

Page 34: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

DoorUnlockedDoor was unlocked.

Duress???

EntranceAPBNotUsed ???

EntranceAPBUsedAnti-passback used.

EntranceDuressNotUsed???

EntranceDuressUsedDoor was forced open.

EntranceFCNotUsed???

EntranceFCUsed???

EntranceFormat???

EntranceFormatReversedUser put their card through backwards.

EntranceFullNotUsed???

EntranceFullUsed???

EntranceHostGrant???

EntranceHostGrantDownload???

EntranceLockedThe entrance was locked.

EntranceNeverAllowedThe door is an exit only.

ExpiredCardSomeone presented an expired card to the reader.

InvalidPINSomeone tried to open the door using an invalid PIN number.

Page 35: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

InvalidSiteCode???

InvalidTimezone???

IssueCode???

NoSecondCard???

OccupancyLimitThe room has reached its occupancy limit. The door did not open.

SiteCodeExtension???

UseLimitThe card has reached its usage limit and did not open the door.

TraceCard???

ValidCardReturn all valid card reads.

ComparisonTypectEquals Performs the comparison field = value

ctGreaterThanPerforms the comparison field > value

ctGreaterThanEqualPerforms the comparison field >= value

ctLessThanPerforms the comparison field < value

ctLessThanEqualPerforms the comparison field <= value

EventTypeHisAlarmIncludes general alarms in the event callback.

HisAlarmAckIncludes alarm acknowledgements in the event callback.

HisAlarmClr Includes alarm clears in the event callback.

Page 36: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

HisAlarmMessageIncludes alarm messages in the event callback.

HisCardIncludes miscellaneous card events in the event callback.

HisCardAckIncludes card acknowledges in the event callback.

HisCardClr Includes card clears in the event callback.

HisCardMessage Includes card messages in the event callback.

HisDatabaseIncludes database events in the event callback.

HisOperatorIncludes operator events in the event callback.

HisSystemIncludes system events in the event callback.

HisSystemAlarmIncludes general system alarms in the event callback.

HisSystemAlarmAckIncludes system alarm acknowledgments in the event callback.

HisSystemAlarmClrIncludes system alarm clears in the event callback.

HisSystemAlarmMessageIncludes system alarm messages in the event callback.

Page 37: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

InstallationThe database API MUST be installed on the same machine that the database server resides on. The database API includes a setup program for deployment. This installs nciwinpak and ncihelper COM dlls and registers them on the machine. Also, there are four examples (2 Visual Basic and 2 Visual C++) included with the installation.

To access the Database API in a client/server relationship you must choose on of the following options:

Set up the WinPak database API for use as a DCOM module

In order to setup the WinPak database API for use with DCOM, use Microsoft Transaction Server (MTS) under Windows NT 4.0 or Component Services (MTS with COM+ support) under Windows 2000. If you do not have MTS installed, you can get it for free from Microsoft as a part of the Windows NT Option Pack. Component Services is automatically installed with Windows 2000. I will refer to both MTS and Component Services as MTS from here on.

You will need to install the following files into MTS:1. NCIHelper.DLL2. NCIHelper.TLB3. NCIWinPak.DLL

For each object installed within MTS, you will need to set the Concurrency--> Synchronization Support to "Requires New." If you do not, MTS will attempt to share the instances of the objects. This is fine for a login, but will cause problems when accessing the cardholder and event callback objects. This will result in unpredictable behavior in any client applications.

Set up the WinPak database API for use as a COM+ module.

For more information on COM or COM+ see: http://www.microsoft.com/com/

Examples

The following examples are installed with the API:

1. VBImpExpTool2. AddCardHolderUI3. VBWinPak4. VCWinPak

Examples 1 & 2These examples demonstrate the very reason for the Database API. The purpose of these examples is to import and export bulk information into and out of your win-pak system. The file names.txt (an old portion of a phone book) is included specifically for use with these examples. To run these examples you must first do some setup in winpak. Create an account, an Access Level and the following note fields: “Street Address”, “City”, “State”, “Zip Code” and “Phone Number”. The AddCardHolderUI VC++ project assumes the names.txt file is in the working directory. All of the VC++ projects have #import "D:\dev\Database API\NCIWinPak\nciwinpak_baseline.dll" hard coded. So this will have to be changed to the installation directory on your machine.

Examples 3 & 4

Page 38: Specifications for the COM/DCOM WinPak Modulesread.pudn.com/downloads118/doc/comm/500366/Databa…  · Web viewWith this API, we have created a set of COM objects that provide the

WIN-PAK Database APIPublic Interface Document

These examples show how to add some win-pak support to a third-party application These applications have a small subset of the win-pak user interface module. After importing the cardholders from example 1 or 2, you can use these examples to browse or change the cardholders.