This page documents how to build and run the SampleLib External Object, which demonstrates both the "direct" and "object" interface to an External Object.
Opening the SampleLib Project on Windows
We assume that you have Visual Studio 2008 installed on your workstation.
- Navigate to SDKINSTALL/cpp/build/samplelib/win
- 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.
- Expand the SampleLib project
- The project contents should resemble the following:
SampleLib/
Header Files
SampleLib.h
SoSharedLibDefs.h
SoCClient.h
Source Files
SampleLib.cpp
- 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:
- Select Build > Configuration Manager
- In the "Active solution configuration" drop dow, set the desired configuration
- 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:
- 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
Opening the SampleLib Project on Mac
- Navigate to Navigate to SDKINSTALL/cpp/build/samplelib/mac
- Double click SampleLib.xcodeproj
- 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
- 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:
- Select Project > Set Active Configuration
- 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:
- 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
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):
- Open loadSampleLib.jsx in the ESTK
- In the "targets" drop-down list, select Bridge CS5/Main Engine
- Run the script by selecting Debug > Run or by pressing F5
- Switch application focus to Bridge
- A new menu item should appear on the menu bar, entitled 'SDK SampleLib'
- Select SDK SampleLib > Exercise SampleLib (Direct calls)
- Switch application focus back to the ESTK
- Inspect the JavaScript console in the ESTK
- In Bridge, Select SDK SampleLib > Exercise SampleLib (Object calls)
- Inspect the JavaScript console in the ESTK