|Oracle® Outside In Content Access Developer's Guide
Part Number E12846-02
Each of the sample applications included in this SDK is designed to highlight a specific aspect of the technology's functionality. We ship built versions of these sample applications. The compiled executables should be in the root directory where the product is installed.
The following copyright applies to all sample applications shipped with this product:
Copyright © Oracle 1993, 2011
All rights reserved.
You have a royalty-free right to use, modify, reproduce and distribute the Sample Applications (and/or any modified version) in any way you find useful, provided that you agree that Oracle has no warranty obligations or liability for any Sample Application files.
Microsoft Visual Studio project files are provided for building each of the sample applications. For 32-bit versions of Windows, versions of the project files are provided for Visual Studio 6 (.dsp files) and Visual Studio 2005 (.vcproj files).
Note:Because .vcproj files may not pick up the right compiler on their own, you need to make sure that you are building with the Win64 configuration in Visual Studio 2005. For 64-bit versions of Windows, only the Visual Studio 2005 versions are available.
The project files for the sample applications can be found in the \sdk\samplecode\win subdirectory of the Outside In SDK.
See the following sections for specific information about building the sample applications on your flavor of UNIX:
Here's a quick tour of the sample applications provided with this product.
Note:Please note that not all of the sample applications are provided for both the Windows and UNIX platforms. See the heading of each application's subsection for clarification.
An example of a typical usage of the Outside In Content Access API is casample. Because this is intended as a simple template or reference for common Content Access usage, it creates only rudimentary output. However, it does initialize, exercise and cleanup Content Access output. Content Access requires the usage of the Outside In Data Access module. Therefore, this application also demonstrates usage of a portion of Data Access.
The application is executed from the command line and takes only one parameter, the name of the input file:
The tademo sample application included with this product provides a simple demonstration of text access. The text from a file is read a block at a time and displayed in the tademo window. The TAReadFirst and TAReadNext functions are directly tied to menu options, and the block size may be set by the user. An option is also provided to save the text to a file.
This tutorial is specific to the Windows application tademo, though the UNIX application textdemo is almost identical. The following sections assume the reader has a basic understanding of the structure of Windows executable source code and Windows API calls.
The bulk of this sample application is in six functions, as detailed in the following sections.
LRESULT MainWndProc ( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
This is the window procedure for the main program window. It is responsible for processing menu options. It includes an information bar at the top that displays the name of the open file, the block read size, and the number and size of the currently displayed block.
long FAR PASCAL DisplayWndProc ( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
This is the window procedure for the window that displays the document text.
int DoTextOpen ( HWND hwnd )
This function is called when the user selects the File menu, then the chooses Open. It calls DAOpenDocument then TAOpenText to initiate text access for the file.
This function simply closes the text and data access handles generated by DoTextOpen, then frees the buffer used by the TAReadFirst and TAReadNext functions.
VTVOID DoSaveTextAs( HWND hwnd)
DoSaveTextAs writes the document's text to a file. In this sample application, the text is always written to the file C:\tademo.txt, but the methods used in the DoSaveTextAs function could easily be enhanced for more flexible options.
This sample provides a means of using the API presented in this guide without the need for Motif libraries. All extracted text is output to the standard output device, or can be redirected to a file or another device.
The sample code in the textdemo files shows how to use the API presented in this guide. This application is essentially identical to the Windows-only application tademo, which is discussed at length in Section 10.3.2, "tademo (Windows Only)."