After you understand how C-level extensibility works in Dreamweaver and its dependency on certain data types and functions, it’s useful to know how to build a library and call a function.
The following example requires the following five files, located in the Dreamweaver-application-folder/ Tutorial_assets/Extending folder as archives for both the Macintosh and Windows platforms:
Build the DLL in Windows using VS.Net 2003
When the build Operation finishes, the Sample.dll file appears in the folder that contains Sample.mak (or one of its subfolders).
Build the DLL in Windows using Microsoft Visual C++
When the build operation finishes, the Sample.dll file appears in the folder that contains Sample.mak (or one of its subfolders).
Build the shared library on the Macintosh using Metrowerks CodeWarrior 9 or later
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.
Build the shared library on the Macintosh using Apple Xcode 1.5 or later
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 Dreamweaver do not recognize it.
Call the computeSum() function from the Insert Horizontal Rule object
function objectTag() { // Return the html tag that should be inserted alert(Sample.computeSum(2,2)); return "<HR>"; }
To execute thecomputeSum()function, select Insert > HTML > Horizontal Rule.
A dialog box that contains the number 4 (the result of computing the sum of 2 plus 2) appears.
标题:Calling a C function from JavaScript
原址:http://helpx.adobe.com/dreamweaver/extend/calling-c-function-javascript.html
新闻热点
疑难解答