Adobe 38040334 - Dreamweaver CS3 User Manual page 368

Extending dreamweaver
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

• The Sample.mak makefile lets you build the Sample.c source file into a DLL with Microsoft Visual C++;
Sample.mcp is the equivalent file for building a Mach-O Bundle with Metrowerks CodeWarrior and Sample.xcode
is the equivalent file for Apple Xcode. If you use another tool, you can create the makefile.
To build the DLL in Windows using VS.Net 2003:
1
Use File > Open, and select Sample.mak with Files Of Type set to All Files (*.*). (VS.Net 2003 does not open MAK
files directly). You are then prompted to verify that you want to convert the project to the new format.
Select Build > Rebuild Solution.
2
When the build operation finishes, the Sample.dll file appears in the folder that contains Sample.mak (or one of its
subfolders).
To build the DLL in Windows using Microsoft Visual C++:
1
In Microsoft Visual C++, select File > Open Workspace, and select Sample.mak.
Select Build > Rebuild All.
2
When the build operation finishes, the Sample.dll file appears in the folder that contains Sample.mak (or one of its
subfolders).
To build the shared library on the Macintosh using Metrowerks CodeWarrior 9 or later:
1
Open Sample.mcp.
Build the project (Project > Make) to generate a Mach-O Bundle.
2
When the build operation finishes, the Sample.bundle file appears in the folder that contains Sample.mcp.
Note: The Mach-O Bundle that is generated can only be used in Dreamweaver 8 and later. Earlier versions of
Dreamweaver do not recognize it.
To build the shared library on the Macintosh using Apple Xcode 1.5 or later:
1
Open Sample.xcode.
Build the project (Build > Build) to generate a Mach-O Bundle.
2
When the build operation finishes, the Sample.bundle file appears in the build folder that is next to the Sample.xcode
file.
Note: The Mach-O Bundle that is generated can only be used in Dreamweaver 8 and later. Earlier versions of Dream-
weaver do not recognize it.
To call the computeSum() function from the Insert Horizontal Rule object:
Create a folder called JSExtensions in the Configuration folder within the Dreamweaver application folder.
1
Copy Sample.dll (Windows) or Sample.bundle (Macintosh) to the JSExtensions folder.
2
3
In a text editor, open the HR.htm file in the Configuration/Objects/Common folder.
Add the line
4
alert(Sample.computeSum(2,2));
example:
function objectTag() {
// Return the html tag that should be inserted
alert(Sample.computeSum(2,2));
return "<HR>";
}
to the
function, as shown in the following
objectTag()
DREAMWEAVER CS3
362
Extending Dreamweaver

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents