Adobe.com
Contents Files

Using the SampleLib Example

Introduction

This page documents how to build and run the SampleLib External Object, which demonstrates both the "direct" and "object" interface to an External Object.

Building the SampleLib project

Building on Windows

Opening the SampleLib Project on Windows

We assume that you have Visual Studio 2008 installed on your workstation.

  1. Navigate to SDKINSTALL/cpp/build/samplelib/win
  2. Double click SampleLib.vcproj and/or open the project in Visual Studio 2008. Use the keyboard shortcut Ctrl-Alt-L or View > Solution Explorer if you cannot see the project files.
  3. Expand the SampleLib project
    • The project contents should resemble the following:
      SampleLib/
      	Header Files
      		SampleLib.h
      		SoSharedLibDefs.h
      		SoCClient.h
      	Source Files
      		SampleLib.cpp
      
  4. Inspect any of the source files by double-clicking them in the Solution Explorer

Building

The project has two different build configurations, Release and Debug. To change to build configuration:

  1. Select Build > Configuration Manager
  2. In the "Active solution configuration" drop dow, set the desired configuration
  3. Press Close

The default path for the project output is dependent on which build configuration was used and will be one of the following:

  • SDKINSTALL/cpp/build/samplelib/win/Release/
  • SDKINSTALL/cpp/build/samplelib/win/Debug/
To create the library then build the project by:
  1. Selecting Build > Build Solution or press 'F7'

If, for example, the Release configuration was used, then the compiled DLL can be found at SDKINSTALL/cpp/build/samplelib/win/Release/SampleLib.dll

Building on Mac

Opening the SampleLib Project on Mac

  1. Navigate to Navigate to SDKINSTALL/cpp/build/samplelib/mac
  2. Double click SampleLib.xcodeproj
  3. Expand the SampleLib project
    • The project contents should resemble the following:
      SampleLib/
      	Source
      		SoCClient.h
      		SoSharedLibDefs.h
      		SampleLib.cpp
      		SampleLib.h
      		SampleLib_Prefix.pch
      	Resources
      		Info.plist
      		InfoPlist.strings		
      	External Frameworks and Libraries
      		Carbon.framework
      	Products
      		SampleLib.framework
      
  4. Inspect any of the source files by double clicking them in the Groups & Files pane

Building

The project has two different build configurations, Release and Debug. To change to build configuration:

  1. Select Project > Set Active Configuration
  2. Choose the configuration you require

The default path for the project output is dependent on which build configuration was used and will be one of the following:

  • SDKINSTALL/cpp/build/samplelib/mac/Release/
  • SDKINSTALL/cpp/build/samplelib/mac/Debug/
To create the framework, build the project by the following:

  1. Selecting Build > Build or press Cmd+B

If, for example, the Release configuration was used then the compiled framework can be found at SDKINSTALL/cpp/build/samplelib/mac/Release/SampleLib.framework

Running the Library

Within the SDKINSTALL/cpp/scripts/ folder, you will find a JavaScript file named loadSampleLib.jsx. This script can be loaded into the ExtendScript Toolkit CS5 and run from that location.

Loading and Running

To load and run the sample from the ExtendScript Toolkit (ESTK):

  1. Open loadSampleLib.jsx in the ESTK
  2. In the "targets" drop-down list, select Bridge CS5/Main Engine
  3. Run the script by selecting Debug > Run or by pressing F5
  4. Switch application focus to Bridge
    • A new menu item should appear on the menu bar, entitled 'SDK SampleLib'
  5. Select SDK SampleLib > Exercise SampleLib (Direct calls)
  6. Switch application focus back to the ESTK
  7. Inspect the JavaScript console in the ESTK
  8. In Bridge, Select SDK SampleLib > Exercise SampleLib (Object calls)
  9. Inspect the JavaScript console in the ESTK
Contents Files
Adobe Solutions Network
 
Copyright © 2010 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks