IBM i Access for Windows Toolkit

C and C++

The following sample programs are available to help develop IBM i Access for Windows applications using C and C++:

ActiveX custom controls

  • - uncapp.exe – Use of Operations Navigator Tree and List controls in a C++ application.

    This Visual C++ sample uses the Operations Navigator Tree and List ActiveX custom controls to create an application that is like Operations Navigator. Application methods are used to get the Tree and List ActiveX controls to communicate with each other, as well as hook up tool and menu bar options.

C/C++ APIs

  • - adsamp1.exe – Demonstrates correct method to determine the version and release of IBM i Access for Windows on the PC.

    This sample illustrates the correct method to determine the version and release of IBM i Access for Windows. This method will return valid values for any release of IBM i Access for Windows 95/NT and also IBM i Access. The sample is written in C++ and has no MFC dependencies.

  • - coconsce.exe – Use of Communications System Object APIs in various connection scenarios.

    This sample demonstrates how an application might use the IBM i Access for Windows Communication APIs related to System Objects. In this example, these APIs are used to create system objects and to set their attributes according to the security and performance requirements of various scenarios. The system objects are then used to run remote commands (using the Remote Command APIs and Service APIs) and to validate user IDs and passwords, and the behavior and some elapsed times can be observed by the user.

  • - cogetsys.exe – Demonstrates using Communications APIs.

    This module is used to demonstrate how an application might use the Communication APIs. In this example, these APIs are used to get and display the list of all configured systems. The user can choose either to be shown all of a system's connection properties (the attributes of the created system object), or to have the ability to connect to all IBM i Access for Windows systems checked. APIs that deal with the System List as well as APIs that deal with individual System Objects are used.

  • - convsamp.exe – Sample using the cwbNL_ConvertCodePages API to perform code page conversion on files.

    This sample demonstrates how an application might use the cwbNL_ConvertCodePages to convert files between ASCII and EBCDIC.

    The sample expects four parameters:

    1. source file name
    2. source code page
    3. target file name
    4. target code page

    The sample reads the source file, converts it from the source code page to the target code page, and saves the result to the target file.

  • - dbapisp1.exe – C programs that demonstrate use of the Database APIs (also referred to as Optimized SQL APIs).

    This is a group of small C programs that demonstrate the use of all three categories of database APIs--Catalog, SQL, and Native Database--to do the following:

  • - dirupdat.exe – C/C++ sample program showing a simple example of setting up Directory Update entries.

    This C/C++ sample program demonstrates creating, configuring, and deleting Directory Update entries. A "Create Update Entry" interface is included, where the required options of an update entry are gathered. This code path calls Directory Update APIs to create the update entry, and an API to set the attributes of the update entry. A "Delete Update Entry" interface is also included. This code path calls the Directory Update APIs necessary to delete an update entry.

    It should be noted that the Directory Update APIs only set up the update entries to be used by the Directory Update application. The Directory Update APIs do not perform the file updates that result from the update entries. The Directory Update application performs the actual update function.

    For more detail on Directory Update, and package file support, read the IBM i Access for Windows User's Guide (that is installed on your PC when IBM i Access for Windows is installed).

  • - dqsamp.exe – Data queue sample written in Visual C++ 4.2 using MFC and the Data Queue APIs.

    This sample uses the IBM i Access for Windows Data Queue APIs to do simple client/system transaction processing and keyed storage. The interface uses the Microsoft Foundation Classes (MFC) for displaying graphical dialogs, storage objects, and for Windows message processing. The code that does the actual data queue operations consists of a set of classes which call the Data Queue APIs.

    Two separate types of data queues are used in the sample. A First-In First-Out (FIFO) queue for transaction messages and a keyed queue for item storage. These queues may reside on different systems.

  • - hllsmp.exe – C sample using the PC5250 Emulation EHLLAPI interface.

    This sample shows how to request keystrokes and log on to a IBM i, using the PC5250 EHLLAPI interface.

  • - logtrace.exe – Sample program showing usage of the IBM i Access for Windows service log and trace APIs.

    This module is used to demonstrate how an application might use the IBM i Access for Windows Serviceability APIs. In this example, these APIs are used to log a message to the history log, and log trace points to the detail trace file.

  • - lstjobx.exe – Display a list of jobs.

    This program uses the System Object Access APIs to display a list of jobs. The list is displayed in a "spreadsheet" form allowing the user to perform actions on the jobs in the list.

  • - lstmsgx.exe – Display a list of messages.

    This program uses the System Object Access APIs to display a list of messages. The list is displayed in a "spreadsheet" form allowing the user to perform actions on the messages in the list.

  • - lstprtx.exe – Display a list of printers.

    This program uses the System Object Access APIs to display a list of printers. The list is displayed in a "spreadsheet" form allowing the user to perform actions on the printers in the list.

  • - lstsplfx.exe – Display a list of spooled files.

    This program uses the System Object Access APIs to display a list of spooled files. The list is displayed in a "spreadsheet" form allowing the user to perform actions on the spooled files in the list.

  • - pcsmain.exe – C sample using the PC5250 Emulation PCSAPI interface.

    PCSMAIN provides a sample dialog that allows you to start, stop connect, and disconnect PC5250 sessions, and perform a simple query to determine the session status as well as to find out what .ws is associated with the session.

  • - printobj.exe – Sample using the system Object APIs to provide access to objects related to printing: printers, spooled files, output queues, etc.

    This sample, when compiled and linked with Microsoft Visual C++, will allow access to spooled files, output queues, writers, printer devices and lists of printer files and libraries. It generates a file named smplnpob.exe which can be run from a DOS command prompt. The source code for this sample provides coding examples which use the cwbOBJ_ set of iSeries Access for Windows APIs.

  • - rcsamp1x.exe – Demonstrates the use of the Remote Program Call API.

    This sample demonstrates using the IBM i Access for Windows Remote Program Call APIs, National Language Support APIs, and the Service APIs to call an OS/400 API and return its output to the PC.

  • - rcsamp2x.exe – Demonstrate the use of Run Comand API.

    This sample demonstrates using the IBM i Access for Windows Run Command API to call an OS/400 command and if an error occurs, retrieve message help for the error message.

  • - usfsampl.exe – Demonstrates the use of the Ultimedia System Facilities (USF) APIs.

    This USF sample uses some of the USF APIs to perform the following:

  • - wdtsampx.exe – Sample program to show how to use the IBM i Access for Windows Data Translation API.

    This program allows the user to pick which translation should be executed from a standard Windows pull-down menu. For each type of translation there is a dialog box that will be displayed on the screen to allow the user to enter values to be translated. When the OK button is pressed, or the enter key is pressed with the cursor in the entry field, the translation will be performed and the results will be displayed. This process will continue until the Cancel button is pressed.

C++

  • - eclmon.exe – A sample Emulator Class Library application which implements a PC5250 "system monitor".

    This is a sample ECL application which implements a PC5250 "system monitor". It monitors the status of all 26 sessions and allows the user to start, stop, connect, and disconnect sessions. It also displays the presenation space, field list, and other information about any session.

  • - eclsamps.exe – A collection of all the Emulator Class Library sample code.

    This is a collection of all the sample code that appears in the C++ chapter of the Emulator Class Library document (SC31-8527-00). Each sample is a function of the form "SampleXXX". A main driver routine is provided which will prompt for a sample number and run the corresponding function. The Emulator Class Library provides a C++ interface to the same set of functions provided by the C EHLLAPI interface. This includes classes that allow you to start and stop PC5250 sessions, query various attributes of the session, retrieve and put data to the screen, and monitor for keystrokes or events.

DDE

  • - spl2file.exe – C sample using the PC5250 Emulation DDE interface.

    When displaying a spooled file on the system, this sample allows you to save the spooled file from the screen to an ASCII file. This sample works only when viewing the spooled file with screen size set to 24x80.

ODBC

  • - odbcsmpl.exe – C Sample Program using the IBM i Access for Windows ODBC Driver.

    This code demonstrates how to use the IBM i Access for Windows ODBC Driver to perform basic SQL tasks, including:

Contact IBM

  • Call IBM Support Line:
    1-800-IBM-SERV (1-800-426-7378)1-800-426-7378
    Inside the US

To draw insights and make better decisions, businesses rely on the secure, flexible and open platform of IBM Power Systems. Built with the first processor designed for big data workloads, the design of Power Systems combines the computing power, memory bandwidth and I/O in ways that are easier to consume and manage, building on strong resiliency, availability and security.

IBM Power Systems deliver flexibility and choice of operating systems to enable your business to support the next generation applications for big data and analytics and cognitive computing that are transforming how organizations work today. Whether running 1, 2, or all 3 - coupled with PowerVM, they maximize the benefit of Power Systems in your business.

Transform your business with Systems Software that enables virtualization, high availability, flexibility, security and compliance on Power Systems™. IBM’s integrated approach to developing Systems and Systems Software together delivers optimized results with Power Systems.

As an open innovation platform, Power Systems is optimized for big data and analytics performance and to deliver scale-out economics and security for the cloud. IBM and IBM Business Partner solutions exploit key capabilities in IBM Power Systems.

Over the last five years thousands of clients have migrated to IBM Power Systems for choice and flexibility. Learn how Power Systems has helped them revolutionise the way IT is developed and delivered, optimise for big data and analytics, and support private, public and hybrid offerings for scale-out or scale-up implementations all while improving business performance, reducing risk, and establishing a platform for growth.

Additional information