This page documents how to build and run the BasicExternalObject sample, which demonstrates using the "direct" interface to an External Object. Note that the instructions apply with appropriate changes for compiling and running the sample named SampleLib, which shows how to use the "object" interface to an External Object. The direct interface is appropriate when you have a library that exposes functions, rather than classes.
Opening the BasicExternalObject Project on Windows
We assume that you have Visual Studio 2008 installed on your workstation.
- Navigate to SDKINSTALL/cpp/build/basicexternalproject/win
- Double click BasicExternalObject.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 BasicExternalObject project
- The project contents should resemble the following:
BasicExternalObject/
Header Files
BasicExternalObject.h
SoSharedLibDefs.h
SoCClient.h
Source Files
BasicExternalObject.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 configuration to build
- Press Close
The default path for the project output is dependant on which build configuration was used and will either of the following:
- SDKINSTALL/cpp/build/basicexternalobject/win/Release/
- SDKINSTALL/cpp/build/basicexternalobject/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/basicexternalobject/win/Release/BasicExternalObject.dll
Opening the BasicExternalObject Project on Mac
- Navigate to SDKINSTALL/cpp/build/basicexternalobject/mac/
- Double click BasicExternalObject.xcodeproj
- Expand the BasicExternalObject project
- The project contents should resemble the following:
BasicExternalObject/
Source
SoSharedLibDefs.h
BasicExternalObject.cpp
BasicExternalObject.h
BasicExternalObject_Prefix.pch
Resources
Info.plist
InfoPlist.strings
External Frameworks and Libraries
Carbon.framework
Products
BasicExternalObject.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 dependant on which build configuration was used and will either be:
- SDKINSTALL/cpp/build/basicexternalobject/mac/Release/
- SDKINSTALL/cpp/build/basicexternalobject/mac/Debug/
To create the famework then build the project by:
- 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/basicexternalobject/mac/Release/BasicExternalObject.framework
Within the SDKINSTALL/cpp/scripts/ folder there is the loadExternalObject.jsx script. This script can be loaded into the ESTK and run from its current location.
Loading and Running
To load and run the sample:
- Open loadExternalObject.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 has appeared on the menu bar, 'SDK External Object'
- Select SDK External Object > Exercise Basic External Object
- Switch applicaton focus back to the ESTK
- Inspect the JavaScript console in the ESTK
- In Bridge select Tools > BeoMenu > BeoMenuItem