IDK Basic Developer's Guide
Total Page:16
File Type:pdf, Size:1020Kb
Basic Developer’s Guide P/N UD 028155 The names, places, and/or events used in this publication are not intended to correspond to any individual, group, or association existing, living, or otherwise. Any similarity or likeness of the names, places, and/or events with the names of any individual, living or otherwise, or that of any group or association is purely coincidental and unintentional. NO WARRANTIES OF ANY NATURE ARE EXTENDED BY THIS DOCUMENT. Any product or related information described herein is only furnished pursuant and subject to the terms and conditions of a duly executed agreement to purchase or lease equipment or to license software. The only warranties made by Unisys, if any, with respect to the products described in this document are set forth in such agreement. Unisys cannot accept any financial or other responsibility that may be the result of your use of the information in this document or software material, including direct, special, or consequential damages. You should be very careful to ensure that the use of this information and/or software material complies with the laws, rules, and regulations of the jurisdictions with respect to which it is used. The information contained herein is subject to change without notice. Revisions may be issued to advise of such changes and/or additions. © 1993 Unisys Corporation. All rights reserved. RESTRICTED RIGHTS LEGEND Use, reproduction, or disclosure is subject to the restrictions set forth in DFARS 252.227–7013 and FARS 52.227–14 for commercial computer software. Attachmate and the Attachmate logo are registered trademarks of Attachmate Corporation in the United States and other countries. INFOConnect is a trademark and Unisys is a registered trademark of Unisys Corporation. All other trademarks and registered trademarks are property of their respective owners. The names, places, and/or events used in this publication are not intended to correspond to any individual, group, or association existing, living, or otherwise. Any similarity or likeness of the names, places, and/or events with the names of any individual, living or otherwise, or that of any group or association is purely coincidental and unintentional. NO WARRANTIES OF ANY NATURE ARE EXTENDED BY THIS DOCUMENT. Any product or related information described herein is only furnished pursuant and subject to the terms and conditions of a duly executed agreement to purchase or lease equipment or to license software. The only warranties made by Unisys, if any, with respect to the products described in this document are set forth in such agreement. Unisys cannot accept any financial or other responsibility that may be the result of your use of the information in this document or software material, including direct, special, or consequential damages. You should be very careful to ensure that the use of this information and/or software material complies with the laws, rules, and regulations of the jurisdictions with respect to which it is used. The information contained herein is subject to change without notice. Revisions may be issued to advise of such changes and/or additions. RESTRICTED RIGHTS LEGEND. Use, reproduction, or disclosure is subject to the restrictions set forth in DFARS 252.227–7013 and FARS 52.227–14 for commercial computer software. Correspondence regarding this publication may be forwarded using the Documentation Questionnaire supplied with this document, or may be addressed directly to Unisys Corporation, INFOConnect Development Group, Malvern Development Center, 2450 Swedesford Road, Room B101, Paoli, Pennsylvania, 19301. Borland products are trademarks or registered trademarks of Borland International, Inc. IBM is a registered trademark of International Business Machines Corporation. Microsoft is a registered trademark and Windows is a trademark of Microsoft Corporation. Novell is a registered trademark of Novell, Inc. Unisys and INFOConnect are trademarks of Unisys Corporation. UNIX AND UNIX System V are registered trademarks of UNIX System Laboratories. XVT is a trademark of XVT Software Inc. Contents About this Guide .......................................................................... xvii Section 1. Installation Windows Platform ....................................................... 1–1 System Requirements ......................................... 1–1 Package Contents ............................................... 1–3 Basic IDK Package ...................................... 1–3 Basic IDK Samples Package ....................... 1–9 Installing the IDK ................................................. 1–17 Environment Variables ........................................ 1–17 System Verification Checklist for Windows ......... 1–19 Preparing XVT for Use with INFOConnect ...................... 1–22 Section 2. An Introduction to INFOConnect Connectivity Services Architecture Diagram .................................................. 2–5 Terminology ............................................................... 2–6 Accessory API Functions ............................................. 2–15 Accessory API Events ................................................. 2–18 Section 3. Writing INFOConnect/Windows Applications Basic Procedures for Windows Applications .................. 3–2 Initializing INFOConnect Connectivity Services .... 3–2 Opening a Session and Allocating Buffers .......... 3–5 Transmitting a Buffer ........................................... 3–8 Receiving a Buffer ............................................... 3–12 Using Datacomm Buffers .................................... 3–15 Basic Error Handling ........................................... 3–17 Basic Status Handling ......................................... 3–22 Closing a Session ............................................... 3–26 Terminating your Application .............................. 3–28 4173 5408-000 v Contents Advanced Procedures for Windows Applications ............ 3–32 Canceling Pending Requests ............................. 3–32 Handling Data Communications Errors .............. 3–33 Advanced Status and Error Handling ................. 3–36 Encoding and Decoding ..................................... 3–38 Data Compression and Error Detection .............. 3–38 Running with Old Versions of INFOConnect ...... 3–39 Procedures for INFOConnect Accessories ..................... 3–41 Calling INFOConnect Accessories ..................... 3–41 Making your Application an INFOConnect Accessory ...................................................... 3–42 Compiling .................................................................. 3–44 Resource Files ............................................................ 3–46 Linking ................................................................... 3–51 IcWinApp - a Sample Windows Application .................... 3–53 CoupleW - a Windows Application that Connects Two INFOConnect Sessions ................................ 3–76 Section 4. Writing INFOConnect/XVT Applications Basic procedures for XVT Applications ......................... 4–2 Initializing INFOConnect Connectivity Services ......................................................... 4–2 Opening a Session and Allocating Buffers ......... 4–3 Transmitting a Buffer .......................................... 4–6 Receiving a Buffer .............................................. 4–8 Using Datacomm Buffers .................................... 4–10 Basic Error Handling ........................................... 4–12 Basic Status Handling ........................................ 4–16 Closing a Session ............................................... 4–19 Terminating your Application .............................. 4–20 Advanced Procedures for XVT Applications ................... 4–24 Canceling Pending Requests ............................. 4–24 Handling Data Communications Errors .............. 4–25 Advanced Status and Error Handling ................. 4–26 Using Event Hooks with XVT 3.0 ........................ 4–29 Using Keyboard and Event Hooks with XVT2.0 ... 4–30 Encoding and Decoding ..................................... 4–31 Data Compression and Error Detection .............. 4–32 Running with Old Versions of INFOConnect ...... 4–32 vi 4173 5408-000 Contents Procedures for INFOConnect Accessories ..................... 4–33 Calling INFOConnect Accessories ...................... 4–34 Making your Application an INFOConnect Accessory ....................................................... 4–34 Compiling .................................................................. 4–37 Windows Platform ............................................... 4–37 Compiler Errors ............................................ 4–39 Resource Files ............................................................ 4–39 Linking ................................................................... 4–40 Windows Platform ............................................... 4–40 IcXvtApp - A sample XVT application ............................. 4–44 Couple - An XVT Application that Connects Two INFOConnect Sessions ................................ 4–46 IcOpenAc - An XVT Application that Opens an INFOConnect Accessory .............................. 4–48 Section 5. Writing INFOConnect/DosLink Applications Basic Procedures for DosLink Applications ................... 5–3 Initializing INFOConnect Connectivity Services ......................................................... 5–3 Opening a Session .............................................. 5–4 Transmitting a Buffer ..........................................