33
Technical Manual OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou Hikvision Digital Tech. Co., Ltd. © 2006-2010 by HIKVISION. All rights reserved.

OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

  • Upload
    others

  • View
    55

  • Download
    0

Embed Size (px)

Citation preview

Page 1: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

OCX SDK Documentation

Version 2.3

(For Windows 2000/XP/2003/Vista)

Hangzhou Hikvision Digital Tech. Co., Ltd.

© 2006-2010 by HIKVISION. All rights reserved.

Page 2: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 1

Notices

The information in this documentation is subject to change without notice and does

not represent any commitment on behalf of HIKVISION. HIKVISION disclaims any

liability whatsoever for incorrect data that may appear in this documentation. The

product(s) described in this documentation are furnished subject to a license and may

only be used in accordance with the terms and conditions of such license.

Copyright © 2006-2010 by HIKVISION. All rights reserved.

This documentation is issued in strict confidence and is to be used only for

the purposes for which it is supplied. It may not be reproduced in whole or in part,

in any form, or by any means or be used for any other purpose without prior written

consent of HIKVISION and then only on the condition that this notice is included in

any such reproduction. No information as to the contents or subject matter of this

documentation, or any part thereof, or arising directly or indirectly therefrom, shall be

given orally or in writing or shall be communicated in any manner whatsoever to any

third party being an individual, firm, or company or any employee thereof without the

prior written consent of HIKVISION. Use of this product is subject to acceptance of the

HIKVISION agreement required to use this product. HIKVISION reserves the right to

make changes to its products as circumstances may warrant, without notice.

This documentation is provided “as-is,” without warranty of any kind.

Please send any comments regarding the documentation to:

[email protected]

Find out more about HIKVISION at www.hikvision.com

Page 3: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 1

CONTENTS

API Instruction....................................................................................................................1

1. Login.............................................................................................................................1 1.1 User Login...............................................................................................................1 1.2 Set UserID for other OCX after successful login .....................................................1

2. Close OCX ...................................................................................................................1 2.1 Logout from IP Devicea...........................................................................................1 2.2 Release OCX..........................................................................................................2

3. Domain Name Analysis ................................................................................................2 4. Get IP Device Information.............................................................................................2 5. Preview Image..............................................................................................................3

5.1 Start Preview...........................................................................................................3 5.2 Stop Preview...........................................................................................................3 5.3 Set the Size of Player Frame Buffer........................................................................3 5.4 Set the Number of B Frame discarded....................................................................4 5.5 Create an I Frame Dynamically...............................................................................4

6.Take Snapshot...............................................................................................................4 6.1 Grab BMP image.....................................................................................................4 6.2 Grab JPEG image...................................................................................................5

7. Intercom .......................................................................................................................5 7.1 Start Intercom..........................................................................................................5 7.2 Stop Intercom..........................................................................................................5 7.3 Set Intercom Volume...............................................................................................6

8. PTZ Control ..................................................................................................................6 8.1 Start PTZ Control ....................................................................................................6 8.2 Stop PTZ Control ....................................................................................................6 8.3 Set Preset ...............................................................................................................7 8.4 Call Preset ..............................................................................................................7

9. Video Parameter...........................................................................................................7 9.1 Get Video Parameter ..............................................................................................7 9.2 Set Video Parameter...............................................................................................8

10. Audio Control ..............................................................................................................8 10.1 Set Audio Mode.....................................................................................................8 10.2 Open Audio ...........................................................................................................8 10.3 Close Audio...........................................................................................................9 10.4 Adjust Volume .......................................................................................................9

11. Record ........................................................................................................................9 11.1 Start Record ..........................................................................................................9 11.2 Stop Record ..........................................................................................................9 11.3 Start Remote Record...........................................................................................10 11.4 Stop Remote Record...........................................................................................10

Page 4: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 2

12. Remote Playback .....................................................................................................10 12.1 Get Record File from IP Device...........................................................................10 12.2 Playback by File Name ....................................................................................... 11 12.3 Playback by Time................................................................................................12 12.4 Stop Playback .....................................................................................................12 12.5 Playback by Time................................................................................................12 12.6 Save Playback File. ............................................................................................13 12.7 Stop Saving Playback File. .................................................................................13 12.8 Get the name of Saved Playback Clip ................................................................13 12.9 Get the OSD Time of Playback File ....................................................................13 12.10 Take Snapshot of Playback File. .......................................................................14 12.11 Download Record by File Name........................................................................14 12.12 Download Record by Time................................................................................14 12.13 Stop Downloading Record by Time...................................................................15 12.14 Get Progress of Downloading. ..........................................................................15 12.15 Get Progress of Playback. ................................................................................16 12.16 Get Playback Time............................................................................................16 12.17 Get Number of Played Frames .........................................................................16 12.18 Get Total Frame Number of Current File ...........................................................16 12.19 Get Total Time of Current File ...........................................................................16 12.20 Refresh the Display to Keep Last Frame ..........................................................17

13. Remote Config..........................................................................................................17 13.1 Set Display Items of Remote Config Dialog ........................................................17 13.2 Pop up Remote Config Dialog.............................................................................17

14. Get Remote DVR Log...............................................................................................18 15. Reboot Device ..........................................................................................................20 16. Restore Factory Parameter ......................................................................................20 17. Alarm Out .................................................................................................................20

17.1 Control Alarm Output ..........................................................................................20 17.2 Get Alarm Output State .......................................................................................20

18. Get Device State.......................................................................................................21 19. Get Channel Name...................................................................................................22 20. Get Last Error ...........................................................................................................22 21. Get Device Name .....................................................................................................23 22. Time Synchronization ...............................................................................................23 23. Remote Config..........................................................................................................24

23.1 Get Remote Config File ......................................................................................24 23.2 Set Remote Config File .......................................................................................24

24 Get Channel Resolution ............................................................................................24 25. Config IP Channel ....................................................................................................25

25.1 Get Configuration of IP Channel .........................................................................25 25.2 Get Detail of IP Channel .....................................................................................25 25.3 Config Analog Channel .......................................................................................26 25.4 Config Analog Channel .......................................................................................26

Page 5: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 3

26. Set Size of Display Window......................................................................................27

Event .................................................................................................................................28

1. SelectWindow() event .............................................................................................28 2. FireExceptionType() event ......................................................................................28

Page 6: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 1

API Instruction

1. Login

1.1 User Login

API: long Login(LPCTSTR lpServerIP, long lPort, LPCTSTR lpUserName, LPCTSTR

lpPassword) Parameters:

lpServerIP: IP address of IP Device, e.g. DVR, IP Camera lPort: Port of IP Device lpUserName: User name of IP Device lpPassword: Password of IP Device

Return Values: If the function succeeds, it will return lUserID, otherwise, it will return -1.

1.2 Set UserID for other OCX after successful login

API: BOOL SetUserID(long lUserID)

Parameters: lUserID:UserID returned by Login();

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE.

2. Close OCX

2.1 Logout from IP Device

API: BOOL Logout()

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE.

Page 7: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 2

2.2 Release OCX

API: BOOL ClearOCX()

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark: It will stop all operations like record, preview.

3. Domain Name Analysis

API: BSTR GetServerIP(LPCTSTR lpURL)

Parameters: lpURL: Domain Name Address

Return Values: If the function succeeds, it will return IP address, otherwise, it will return NULL.

Remark: Analyze domain name and get the IP address of IP Device

4. Get IP Device Information

API: BSTR GetServerInfo()

Return Values: Return IP device information by a string in XML format: <?xml version='1.0'?> <ServerInfo> < ChannelNumber> byChanNum </ChannelNumber >

//Analog Channel Number < DVRType> byDVRType </DVRType> //IP Device Model < DiskNumber> byDiskNum </DiskNumber> //Hard Disk Number < SerialNumber> bySerialNumber </SerialNumber> //Serial Number < AlarmInPortNum> byAlarmInPortNum </AlarmPortNum>

//Alarm Input of Analog Channel <AlarmOutPortNum> byAlarmOutPortNum </AlarmOutPortNum>

// Alarm Output of Analog Channel

< StartChannel> byStartChan </StartChannel> //Start Channel <AudioChanNum>byAudioChanNum</AudioChanNum> // Audio Channel Number

Page 8: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 3

<MaxDigitChannelNum>byMaxDigitChannelNum</MaxDigitChannelNum>

//Maximum Digital Channel Number </ServerInfo>

Remark: It’s available after successful login.

5. Preview Image

5.1 Start Preview

API: BOOL StartRealPlay(long lChannelNum ,long lProtocolType, long lStreamType)

Parameters: lChannelNum: channel number, first channel is Channel 0. lProtocolType: network protocol, 0 - TCP, 1-UDP lStreamType: stream type: 0 - main stream, 1 - sub stream

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

If SetPlayWndType() has been invoked, preview window size will be set to lPlayWndType.

Otherwise, if the resolution is HD720p or HD900p, preview image will be 16:9. If it’s other resolution, preview image will be 4:3. If can’t get resolution, the preview size will be the size of OCX.

5.2 Stop Preview

API: BOOL StopRealPlay()

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE.

5.3 Set the Size of Player Frame Buffer

API: BOOL SetRealPlayBufNumber(long lBufNumber)

Parameters: lBufNumber: Size of Player Frame Buffer, value is 1 to 50. The bigger the buffer is,

the smoother is video is, and the smaller the buffer is, the more real-time the image is.

Page 9: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 4

If the stream type is Video & Audio, the size should be 6 at least Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

It is available while preview.

5.4 Set the Number of B Frame discarded

API: BOOL RealPlayThrowBFrame(long lThrowBType)

Parameters: lThrowBType: the number of B frame that will be discarded, 0 - none, 1 - discard one B frame, 2 - discard two B frames.

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

It is available while preview.

5.5 Create an I Frame Dynamically

API: BOOL MakeKeyFrame(long lChannelNum)

Parameters: LChannelNum: channel number.

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

It is available while preview.

6. Take Snapshot

6.1 Grab BMP image

API: BOOL BMPCapturePicture(LPCTSTR lpSavePath, BOOL bShowSaveFile)

Parameters: lpSavePath: Set the path for saving BMP image, “C:\OCXBMPCaptureFiles” is

default. And the image will be in folder named BMPCapture bShowSaveFile: if show the BMPCapture folder after grabbing BMP image

Return Values:

Page 10: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 5

If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

It is available while preview.

6.2 Grab JPEG image

API: BOOL JPEGCapturePicture(long lChannelNum, short iPicSize, short iPicQuality,

LPCTSTR lpSavePath, BOOL bShowSaveFile) Parameters:

lChannelNum: channel number, the first channel is 1, and the second channel is 2. iPicSize: resolution, 0=CIF 1=QCIF, 2=4CIF 3=UXGA(1600x1200),

4=SVGA(800x600), 5=HD720p(1280x720),6=VGA iPicQuality: image quality, 0 - Best, 1 - Better, 2 - Normal lpSavePath: Set the path for saving BMP image, “C:\OCXJPEGCaptureFiles” is

default. And the image will be in folder named JPEGCapture bShowSaveFile: if show the JPEGCapturefolder after grabbing BMP image

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

Grabbing JPEG image does not need preview. When video resolution is VGA, the iPicSize supports 0=CIF, 1=QCIF, 2=4CIF, when video resolution is 3=UXGA(1600x1200), 4=SVGA(800x600), 5=HD720p(1280x720),6=VGA,7=XVGA, or 8=HD900p, iPicSize only supports the current resolution.

7. Intercom

7.1 Start Intercom

API: BOOL StartTalk(long lTalkChanNum) Parameters: lTalkChanNum: intercom channel Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE.

7.2 Stop Intercom

API: BOOL StopTalk() Return Values:

Page 11: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 6

If the function succeeds, it will return TRUE, otherwise, it will return FALSE.

7.3 Set Intercom Volume

API: BOOL SetVoiceComClientVolume(long lVolume)

Parameters: lVolume: volume, value is 1 to 10 Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE.

8. PTZ Control

8.1 Start PTZ Control

API: BOOL PTZCtrlStart(long lCtrlType,long lSpeed)

Parameters: lCtrlType: :0 - up, 1 - down, 2 - left, 3 -- right, 4 - zoom in, 5 - zoom out, 6 - focus

near, 7 - focus far, 8 - iris down, 9 - iris up,10 - auto, 11 - light, 12 - brush,13 - up left, 14 - up-right, 15 - down-left, 16 - down-right

lSpeed: PTZ speed, the value is from 1 to 7. If set to 0, it will control the PTZ without speed parameter. Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

It is available while preview.

8.2 Stop PTZ Control

API: BOOL PTZCtrlStop(long lCtrlType,long lSpeed)

Parameters: lCtrlType: :0 - up, 1 - down, 2 - left, 3 -- right, 4 - zoom in, 5 - zoom out, 6 - focus

near, 7 - focus far, 8 - iris down, 9 - iris up,10 - auto, 11 - light, 12 - brush,13 - up left, 14 - up-right, 15 - down-left, 16 - down-right

lSpeed: PTZ speed, the value is from 1 to 7. If set to 0, it will control the PTZ without speed parameter. Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

Page 12: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 7

It is available while preview.

8.3 Set Preset

API: BOOL PTZCtrlSetPreset(long lPresetNumber)

Parameters: lPresetNumber: preset No., 256 in total. Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

It is available while preview.

8.4 Call Preset

API: BOOL PTZCtrlGotoPreset(long lPresetNumber)

Parameters: lPresetNumber: preset No., 256 in total. Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

It is available while preview.

9. Video Parameter

9.1 Get Video Parameter

API: BSTR GetVideoEffect()

Return Values: If the function succeeds, it will return a String in XML format, otherwise, it will return NULL. <?xml version='1.0'?> <VideoEffect> <Bright>byBright</Bright> //Brightness (1 - 10) <Contrast>byContrast</Contrast> //Contrast (1- 10) <Saturation>bySaturation</Saturation> //Saturation (1- 10) <Hue>byHue</Hue> //Hue (1 - 10)

</VideoEffect> Remark:

Page 13: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 8

It is available while preview.

9.2 Set Video Parameter

API: BOOL SetVideoEffect(long lBrightValue, long lContrastValue, long

lSaturationValue, long lHueValue) Parameters: lBrightValue: Brightness (1 - 10) lContrastValue Contrast (1- 10) lSaturationValue Saturation (1- 10) lHueValue Hue (1 - 10) Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

It is available while preview.

10. Audio Control

10.1 Set Audio Mode

API: BOOL SetAudioMode(long lSoundMode)

Parameters: lSoundMode: audio mode, 1 - exclusive mode, 2 - share mode Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

Invoke it before preview.

10.2 Open Audio

API: BOOL OpenSound(long lSoundMode)

Parameters: lSoundMode: audio mode, 1 - exclusive mode, 2 - share mode Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

It is available while preview.

Page 14: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 9

10.3 Close Audio

API: BOOL CloseSound(long lSoundMode)

Parameters: lSoundMode: audio mode, 1 - exclusive mode, 2 - share mode Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

It is available while preview.

10.4 Adjust Volume

API: BOOL SetVolume(long lVolume)

Parameters: lVolume: audio volume, value is from 1 to 9 Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE.

11. Record

11.1 Start Record

API: BOOL StartRecord(LPCTSTR lpSavePath)

Parameters: lpSavePath: path for saving video file, C:\OCXRecordFiles is default, and video is

saved in folder named current date, e.g. C:\OCXRecordFiles\2009-07-13.

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

It is available while preview.

11.2 Stop Record

API: BOOL StopRecord(BOOL bShowSaveFile)

Parameters: bShowSaveFile: If show the folder for saving video after stopping record.

Page 15: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 10

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

It is available while preview.

11.3 Start Remote Record

API: BOOL StartRemoteRecord(long lChannelNum)

Parameters: lChannelNum: Channel No., 0 stands for first channel.

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE.

11.4 Stop Remote Record

API: BOOL StopRemoteRecord(long lChannelNum)

Parameters: lChannelNum: Channel No., 0 stands for first channel.

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE.

12. Remote Playback

12.1 Get Record File from IP Device

API: BSTR SearchRemoteRecordFile(long lChannelNum, long lFileType, LPCTSTR

lpStartTime, LPCTSTR lpStopTime, BOOL bATMType, BOOL bNeedCardNum, LPCTSTR lpCardNumber) Parameters:

lChannelNum: Channel No., 0 stands for first channel. lFileType: file type searched. If it is not for ATM: bATMType is false, 0 - All, 1 -

schedule recording, 2 - Motion detection, 3 - Alarm trigger, 4 - Alarm | Motion, 5 - Alarm&Motion,6 - Command, 7 - Manual. If it is for ATM: bATMType is true, 0 - All, 1 - schedule recording, 2 - Motion detection, 3 - Approach, 4 - Cash in, 5 - Cash out, 6 - Command, 7 - Manual, 8 - shake

lpStartTime: Start time,format:2007-3-8 2:30:50. Can’t be null lpStopTime: End time,format:2007-3-9 10:30:47. Can’t be null

Page 16: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 11

bATMType: whether searching by card No. TRUE means Yes and FALSE means No

bNeedCardNum: whether need the information of Card No. TRUE means Yes and FALSE means No

lpCardNumber:Card No. Info Return Values:

Return result by a string in XML format: If String is ”null”, it means no record. If it has no content, it means failure, and the reason as below: lUserID is less than 0, Channel No. does not exist, Start time is later than end time, Failed to get file list, The server is busy, or network error, Get file list abnormal end.

structure: <?xml version='1.0'?> <SearchRemoteRecordFile> <File> <Index>dwIndex</Index> <FileName> sFileName </FileName> //File name <StartTime> struStartTime </StartTime> // File name <StopTime> struStopTime </StopTime> //End time <FileSize> dwFileSize </ FileSize > //File size </File> <File> <Index>dwIndex</Index> <FileName> sFileName </FileName> // File name <StartTime> struStartTime </StartTime> // File name <StopTime> struStopTime </StopTime> // End time <FileSize> dwFileSize </ FileSize > // File size </File>

… … //other recordings in same format </ SearchRemoteRecordFile >

12.2 Playback by File Name

API: BOOL PlayBackByName(LPCTSTR lpFileName)

Parameters: LPCTSTR lpFileName name of file need be playback.

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

If SetPlayWndType() has been invoked, preview window size will be set to

Page 17: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 12

lPlayWndType. Otherwise, it will accord the resolution of main stream.

12.3 Playback by Time

API: BOOL PlayBackByTime (long lChannelNum, LPCTSTR lpStartTime, LPCTSTR

lpStopTime) Parameters:

lChannelNum: Channel No., 0 denote the first channel. lpStartTime: Start time,format:2007-3-8 2:30:50. Can’t be null lpStopTime: End time,format:2007-3-9 10:30:47. Can’t be null

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

If SetPlayWndType() has been invoked, preview window size will be set to lPlayWndType.

Otherwise, it will accord the resolution of main stream.

12.4 Stop Playback

API: BOOL StopPlayBack()

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE.

12.5 Playback by Time

API: BOOL PlayBackControl(long lPlayBackControlType, long lInValue)

Parameters: Long lPlayBackControlType: 1-play, 2-stop, 3-pause, 4-replay, 5-forward, 6-rewind,

7-normal, 8-play by frame, 9-open sound, 10-close sound, 11-volume, 12-change progress, 20-discard B frame

lInValue:enter the parameters that some control commands may need Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE.

Page 18: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 13

12.6 Save Playback File.

API: BOOL PlayBackSaveFile(LPCTSTR lpSaveFileName)

Parameters: lpSaveFileName: File name for vide clip.

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

Save the playback file.

12.7 Stop Saving Playback File.

API: BOOL StopSaveFile()

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

Stop saving the playback file.

12.8 Get the name of Saved Playback Clip

API: BSTR GetPlaybackSaveFileName()

Return Values: If the function succeeds, it will return the file name.

12.9 Get the OSD Time of Playback File

API: BSTR GetPlaybackOSDTime()

Return Values: If the function succeeds, it will return Standard Time. Otherwise it will return null.

Page 19: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 14

12.10 Take Snapshot of Playback File.

API: BOOL PlayBackCapture(LPCTSTR lpSavePath , BOOL bShowSaveFile)

Parameters: lpSavePath: Picture name, which default path is C:\OCXSaveAllFiles\, and the

picture is in the sub folder named PlaybackCapture bShowSaveFile: If show the folder PlaybackCapture after capturing.

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE.

12.11 Download Record by File Name.

API: BOOL DownLoadByFileName(LPCTSTR lpRecordFileName, LPCTSTR

lpDownLoadPath) Parameters:

lpRecordFileName: Name of file need be downloaded. lpDownLoadPath: Path for saving file, which default value is

C:\OCXDownloadFiles\, and the picture is in the sub folder named by current date

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

The name of downloaded file is IPAddress_ChannelNo._CurrentTime.mp4.

12.12 Download Record by Time.

API (1): BOOL DownLoadByTime(long lChannelNum, LPCTSTR lpStartTime, LPCTSTR lpStopTime, LPCTSTR lpDownLoadPath)

Parameters: lChannelNum: Channel No., 0 denote the first channel. lpStartTime: Start time,format:2007-3-8 2:30:50. Can’t be null lpStopTime: End time,format:2007-3-9 10:30:47. Can’t be null lpDownLoadPath: Path for saving file, which default value is

C:\OCXDownloadFiles\, and the picture is in the sub folder named by current date

Return Values:

Page 20: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 15

If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

The name of downloaded file is IPAddress_ChannelNo._CurrentTime.mp4.

API (2): BOOL DownLoadByTimeV23(long lChannelNum, LPCTSTR lpStartTime, LPCTSTR lpStopTime, LPCTSTR lpDownLoadPath)

Parameters: lChannelNum: Channel No., 0 denote the first channel. lpStartTime: Start time,format:2007-3-8 2:30:50. Can’t be null lpStopTime: End time,format:2007-3-9 10:30:47. Can’t be null lpDownLoadPath: Path for saving file, which default value is

C:\OCXDownloadFiles\, and the picture is in the sub folder named by current date

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

The name of downloaded file is IPAddress_PortNo._ChannelNo._FileStartTime_RandomeTime.mp4.

12.13 Stop Downloading Record by Time.

API: BOOL StopDownLoadFile()

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE.

12.14 Get Progress of Downloading.

API: long GetDownloadPos()

Return Values: returns: -1 failed, 0-100 download progress, 100 download is finished, more

than 100 that means download abnormal ends because of network error.

Page 21: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 16

12.15 Get Progress of Playback.

API: long GetPlayBackPos()

Return Values: Returns: -1 failed, 0-100 playback progress, 100 denotes playback is finished,

more than 100 that means playback abnormal ends because of network error.

12.16 Get Playback Time

API: long GetPlayBackTime ()

Return Values: Returns: -1 failed, other value is the total second. e.g. lPlaybackCurrentTime = m_OCX1.GetPlayBackTime(); lPlaybackCurrentHour = lPlaybackCurrentTime / 3600; lPlaybackCurrentMinute = (lPlaybackCurrentTime % 3600 ) / 60; lPlaybackCurrentSecond = lPlaybackCurrentTime % 60;

12.17 Get Number of Played Frames

API: long GetPlayBackFrame ()

Return Values: Returns: -1 failed, other value is the number of frames.

12.18 Get Total Frame Number of Current File

API: long GetPlayBackTotalFrame ()

Return Values: Returns: -1 failed, other value is the number of total frames.

12.19 Get Total Time of Current File

API:

Page 22: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 17

long GetPlayBackTotalTime () Return Values:

Returns: -1 failed, other value is the total time. e.g. lPlaybackTotalTime = m_OCX1. GetPlayBackTotalTime (); lPlaybackTotalHour = lPlaybackTotalTime / 3600; lPlaybackTotalMinute = (lPlaybackTotalTime % 3600 ) / 60; lPlaybackTotalSecond = lPlaybackTotalTime % 60;

12.20 Refresh the Display to Keep Last Frame

API: BOOL PlayBackRefresh()

Return Values: Returns: -1 denotes failure, other value denotes success

Remark: When playing one frame by one frame or pause playback, invoke this API to keep

the last Image.

13. Remote Config

13.1 Set Display Items of Remote Config Dialog

API: BOOL SetRemCfgNode(long lMainNode, long lSubNode, long bEnable)

Parameters: lMainNode: Config the index value of tree’s Main node (0xff – All); lSubNode: Config the index value of tree’s sub node (0xff - All); bEnable: Enable or not.

Return Values: Returns: FALSE denotes failure, TRUE denotes success

Remark: It should be invoked before SetRemoteConfig()

13.2 Pop up Remote Config Dialog

API: BOOL SetRemoteConfig(LPCTSTR lpUserName, long lLanguageType, BOOL bShowIPCCfg, long lBkColorType, long lColorType)

Page 23: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 18

Parameters: lpUserName: User name Of IP Device. lLanguageType: Language, 0 – Simplified Chinese, 1 – English. bShowIPCCfg: Show IP Cam Config Dialog or not. lBkColorType: Background Color. lColorType Font Color.

Return Values: Returns: FALSE denotes failure, TRUE denotes success

14. Get Remote DVR Log

API: BSTR SearchRemoteLogInfo(long lSelectMode, long lMajorType, long lMinorType,

LPCTSTR lpStartTime, LPCTSTR lpStopTime, BOOL bSearchSmart) Parameters:

lSelectMode: 0 - all, 1 - by type, 2 - by time, 3 - by time and type lMajorType: 0 - all, 1 - alarm,2 - exception, 3 - operation, 4 - Additional Info lMinorType 0 – all(others have different value according to different major type). lpStartTime: Start time,format:2007-3-8 2:30:50. Can’t be null lpStopTime: End time,format:2007-3-9 10:30:47. Can’t be null bSearchSmart: Search SMART info or not, if it’s TRUE, lSelectMode,

lMajorType and lMinorType are invalid. Return Values:

Return result by a string in XML format: If String is”null”, it means no record. If it has no content, it means failure, and the reason as below: lUserID is less than 0, Channel No. does not exist, Start time is later than end time, The server is busy, or network error, Get Log abnormal end.

structure: <?xml version='1.0'?>

<SearchLog> <LogInfo> <Index>dwIndex</Index> // Index <LogTime> strLogTime </LogTime> //Log Time <AlarmInPort>dwAlarmInPort</AlarmInPort> //Alarm Input Port <AlarmOutPort>dwAlarmOutPort</AlarmOutPort> //Alarm Output Port < HardDiskNumber>dwHardDiskNumber</HardDiskNumber> //HDD number. <ChannelNumber>dwChannelNumber</ChannelNumber> //Channel Number, -1 - All, 0 - None

Page 24: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 19

<MajorType> dwMajorType </MajorType> // Major Type <MinorType> dwMinorType </MinorType> //Minor Type <NetUser>strNetUser</NetUser> //Network User <NetUserIP>strNetUserIP</NetUserIP> //Remote User’s IP <LocalUser>strLocalUser</LocalUser> //Local User

<LogInfomation>strLogInfomation</LogInfomation> //Log Detail </LogInfo> <LogInfo> ……// Another log </LogInfo>

… … </SearchLog>

Remark: When the dwAlarmInPort, dwAlarmOutPort, dwHardDiskNumber, and

ChannelNumber are 0, strLocalUser and strNetUser are null, the corresponding return values in xml format is “null”.

The values of dwMajorType: 1 - alarm, 2 - exception, 3 – operation, 4 - Additional Info. When dwMajorType is 1, the values of the dwMinorType:

1 - alarm input, 2 - alarm output, 3 - motion detection start, 4-motion detection stop, 5 – view tampering alarm start, 6 - view tampering alarm stop

When dwMajorType is 2, the values of the dwMinorType: 1 – signal lost, 2 - illegal access, 3 – hard disk full, 4 – hard disk error, 5 – modem lost connection, 6 – IP conflicts, 7 - net cable cut. 8 - ecord failed. 9 – IP Camera disconnected. 10 - analog video input exception

When dwMajorType is 3, the values of the dwMinorType: 1 – power on, 2 – power off, 3 – shutdown illegally, 4 – local reboot 5 - local login, 6 - local logout, 7 - local configuration, 8 - local playback by file, 9 - local playback by time, 10 - local start recording, 11 - local stop recording, 12 - local PTZ control, 13 - local preview, 14 - local config time, 15 - local upgrade, 16 - local export video, 17 - local format hard disk, 18 – export local config file, 19 – import local config file, 20 – local backup file, 21 – local lock file, 22 – local unlock file, 23 – local stop or trigger alarm 24 – local add IP Camera, 25 – local delete IP Camera, 26 – local config IP Camera, 27 - remote login, 28 – remote logout, 29 - remote start recording, 30 – remote stop recording, 31 - start transparent transfer, 32 - stop transparent transfer, 33 - remote get parameters, 34 - remote set parameters, 35- remote get status, 36 - remote set defend, 37 – remote disarm, 38 - remote reboot, 39 - start voice talk, 40 - stop voice talk, 41 - remote upgrade, 42 - remote playback by file, 43 -remote playback by time, 44- remote PTZ control. 45 – remote format hard disk, 46 – remote shut down, 47 – remote lock file, 48 – remote unlock file, 49 – remote export config file,

Page 25: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 20

50 – remote import config file, 51 – remote export video file, 52 – remote stop or trigger alarm manually, 53 – remote add IP Camera 54 – remote delete IP Camera, 55 – remote config IP Camera

When dwMajorType is 4, the values of the dwMinorType: 1 – hard disk info, 2 – SMART info, 3 – start recording, 4 – stop recording 5 – delete expired video record.

15. Reboot Device

API: BOOL RebootServer ()

Return Values: Returns: FALSE denotes failure, TRUE denotes success

16. Restore Factory Parameter

API: BOOL RestoreConfig ()

Return Values: Returns: FALSE denotes failure, TRUE denotes success

17. Alarm Out

17.1 Control Alarm Output

API: BOOL ControlAlarmOut(long lAlarmOutNum, long lAlarmOutStatic)

Parameters: lAlarmOutNum: Alarm output NO. lAlarmOutStatic: State: 0 – Stop output, 1 – Start output;

Return Values: Returns: FALSE denotes failure, TRUE denotes success

17.2 Get Alarm Output State

API: long GetAlarmOutStatus(long lAlarmOutNum)

Page 26: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 21

Parameters: lAlarmOutNum: NO. of Alarm output port.

Return Values: Returns: -1 denotes failure, 0 – invalid, 1 – valid.

18. Get Device State

API: BSTR GetServerWorkState()

Return Values: Return a string in XML format: If String has no content, it means failure

<?xml version='1.0'?> <ServerWorkState> <ServerStatic>dwServerStatic< /ServerStatic> // Device state <LocalShowStatic> dwLocalShowStatic < /LocalShowStatic> // local display state

<ChannelState> <Record> byRecord < /Record> //Recording or not <Signal> bySignal < /Signal> //Camera signal state <HardWareStatic>byHardWareStatic</HardWareStatic>

//Channel hardware state <BitRate> byBitRate </BitRate> //actual bit rate <LinkNum> byLingkNum </LinkNum> //Number of connections … … </ChannelState> <HardDiskState> <Volume>byVolume</Volume> //HD Capacity <FreeSpace>byFreeSpace< /FreeSpace> //HD free space <HardDiskStatic>byHardDiskStatic</HardDiskStatic>

//HD state …. … </HardDiskState> </ServerWorkState>

Remark: The value of dwServerStatic:

0 - normal, 1 - CPU usage is above 85%, 2 - hardware error The value of dwLocalShowStatic: 0 - normal, 1 - abnormal The value of byRecord: 0 - not record, 1 - record The value of bySignal: 0 - normal, 1 - lost signal The value of byHardWareStatic: 0 - normal, 1 - abnormal The value of byHardDiskStatic: 0 - active, 1 - dormant, 2 - abnormal

Page 27: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 22

19. Get Channel Name

API: BSTR GetChannelName(long lChannelNum)

Parameters: lChannelNum: Start with 0;

Return Values: Returns channel name, if return null, it means failure.

20. Get Last Error

API: long GetLastError()

Return Values: 0 – no error, 1 – user id or password error,2 – no authority, 3 – no initialization, 4 – wrong channel number,5 – the number of clients connecting with DVR is beyond the maximum. 6 - the version does not match, 7 - connect server failure, 8 -fail to sent to server, 9 - fail to receive from the server, 10 - receive data from the server time out, 11- transfer data error, 12-invoke in wrong order, 13-no such right, 14 - DVR execute commands time out, 15 - wrong serial port, 16 - alarm port wrong, 17 - wrong parameter, 18 - server channel in wrong state, 19-no disc, 20 - wrong disc number, 21 - disc full, 22 - disc error, 23 - server does not support, 24 - server is busy, 25 - server fail to modify, 26 - password in wrong format, 27 - disc is formatting at this moment, 28 - DVR resource is not enough, 29-DVR operation failure, 30 - fail to open PC sound, 31 - server voice talk is occupied, 32 - time input wrong, 33 - the server has no such specified file when playback, 34 - fail to create file, 35 - fail to open file, 36 - the previous operation is not finished yet, 37 - fail to get the time of the file being played, 38 - play failure, 39 - file’s format is not correct, 40 - wrong path, 41 - resources allocation failure, 42 - sound card mode error, 43 - the buffer is too small, 44 - fail to create SOCKET, 45 - set SOCKET failure, 46 - the number exceed the maximum, 47 - user does not exist, 48 - write FLASH failure, 49-fail to upgrade DVR, 50 - decode card has been initialized already, 51 - errors from the player, 52 - users exceed the maximum, 53 - fail to get the IP address or MAC address of the Client, 54 - the channel has not encode yet, 55 - IP addresses are not matched, 56 - MAC addresses are not matched, 57 - the languages of the upgrade files are not matched, 58 – the number of player exceed the maximum, 59 – backup device has no enough space for backup, 60 –can’t find the specified backup device, 61 – image bits is not correct, 24bits only, 62 – width*height exceed 128*256, 63 – image size exceed 100K, 64 – load player SDK error, 65 – can’t find some API in player SDK, 66 – load DsSdk.dll error, 67 – can’t find some API in DsSdk.dll, 68 – failed to invoke API of DsSdk.dll, 69 – Sound card is exclusive, 70 – failed to join to multicast, 71 – failed to create log file folder, 72 –

Page 28: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 23

bind socket failed, 73 – socket disconnected, 74 – user ID is operating when log out, 75 – listening failed, 76 – application abnormal, 77 – write file failed, 78 – it’s forbidden to format read only hard disk, 79 – user name conflict in user config structure, 80 – device model doesn’t match when importing parameters, 81 – language doesn’t match when importing parameters, 82 – software version doesn’t match when importing parameters, 83 – IP channel is not online when preview, 84 – load StreamTransClient.dll for Mega Pixel Camera failed, 85 – load CVT_StdToHik.dll failed.

21. Get Device Name

API: BSTR GetServerName()

Return Values: Returns device name, if return null, it means failure.

22. Time Synchronization

API (1): BOOL CheckTime()

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

Synchronize with PC’s time.

API (2): BOOL SetServerTime(LPCTSTR lpServerTime)

Parameters: lpServerTime: Time for synchronization, time format is 2009-05-18 12:00:00;

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

Synchronize with lpServerTime input

Page 29: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 24

23. Remote Config

23.1 Get Remote Config File

API: BOOL GetRemoteConfigFile(LPCTSTR lpFilePath)

Parameters: lpFilePath: file for saving;

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE.

23.2 Set Remote Config File

API: BOOL SetRemoteConfigFile(LPCTSTR lpFilePath)

Parameters: lpFilePath: file for setting;

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE.

24 Get Channel Resolution

API: long GetChannelResolution(long lChannelNum, long lStreamType)

Parameters: lChannelNum: Channel Number; lStreamType: Stream Type: 0 – Main Stream, 1 – Sub Stream

Return Values: If the function succeeds, it will return the channel’s resolution:

0 - DCIF, 1 - CIF, 2 - QCIF, 3 - 4CIF, 4 - 2CIF, 16 - VGA (640*480), 17 - UXGA (1600*1200), 18 - SVGA (800*600), 19 - HD720p (1280*720), 20 - XVGA, 21 - HD900p

Page 30: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 25

25. Config IP Channel

25.1 Get Configuration of IP Channel

API: BOOL GetIPParaCfg()

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark:

Invoke it before GetIPCConfig().

25.2 Get Detail of IP Channel

API: BSTR GetIPCConfig()

Return Values: Return the IP channel info by a String in XML format: <?xml version='1.0'?> <IPCCFG> <ANALOGCHAN> <AnalogChannelEnable></AnalogChannelEnable>

// Enable Analog channel or not </ANALOGCHAN> <ANALOGCHAN> …//Same Struct </ANALOGCHAN> … … <DIGITCHAN> <DigitChanNo> </DigitChanNo> //Digital Channel NO. <DeviceID> </DeviceID>

//Device ID, it will be 0, when IP channel is disabled <DigitServerEnable> </DigitServerEnable> //Enable Server or not <DigitChanEnable> </DigitChanEnable> //Channel is online or not <DeviceIP> </DeviceIP> //Device IP <DeviceUserName> </DeviceUserName> //Device’s Username <DeviceUserPsw> </DeviceUserPsw> //Device’s Password <DevicePort> </DevicePort> //Device Port Number <DeviceChannel> </DeviceChannel> //Device channel </DIGITCHAN> <DIGITCHAN> …//Same struct

Page 31: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 26

</DIGITCHAN> … …

</IPCCFG >

25.3 Config Analog Channel

API: BOOL SetAnalogChannel(LPCTSTR lpAnalogChanXML) Parameters:

lpAnalogChanXML: Analog channel use the XML or not; Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark: The format is :

<?xml version='1.0'?> <ANALOGCHAN>

<AnalogChannelEnable></AnalogChannelEnable> // Enable or not <AnalogChannelEnable></AnalogChannelEnable> // Enable or not <AnalogChannelEnable></AnalogChannelEnable> // Enable or not <AnalogChannelEnable></AnalogChannelEnable> // Enable or not ……

</ANALOGCHAN>

25.4 Config Analog Channel

API: BOOL SetDigitChannel(LPCTSTR lpDigitChanXML)

Parameters: lpDigitChanXML: XML for Analog channel

Return Values: If the function succeeds, it will return TRUE, otherwise, it will return FALSE. Remark: The format is :

<?xml version='1.0'?> <DIGITCHANCFG>

<DIGITCHAN> <DigitChanNo> </DigitChanNo> //Digital Channel NO.

<DeviceID> </DeviceID> //Device ID, it will be 0, when IP channel is disabled

<DigitServerEnable> </DigitServerEnable> //Enable Server or not <DigitChanEnable> </DigitChanEnable> //Channel is enable or not

Page 32: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 27

<DeviceIP> </DeviceIP> //Device IP <DeviceUserName> </DeviceUserName> //Device’s Username <DeviceUserPsw> </DeviceUserPsw> //Device’s Password <DevicePort> </DevicePort> //Device Port Number <DeviceChannel> </DeviceChannel> //Device channel </DIGITCHAN>

</ DIGITCHANCFG >

26. Set Size of Display Window

API: Void SetPlayWndType(long lPlayWndType)

Parameters: lPlayWndType: 0 – fill window, 1 – 4:3 mode, 2 – 16:9 mode

Page 33: OCX SDK Documentation Version 2polaniec.pl/uploads/download/ola/Kamera/OCX SDK Manual(V2... · 2013-08-09 · OCX SDK Documentation Version 2.3 (For Windows 2000/XP/2003/Vista) Hangzhou

Technical Manual

© 2006-2010 by HIKVISION. All rights reserved. 28

Event

1. SelectWindow() event

SelectWindow() event will be triggered when clicking ActiveX control. Get the current control: FireSelectWindow().

2. FireExceptionType() event

FireExceptionType(wParam, lParam) will be triggered when having exception