Chapter 21: C-Level Extensibility; How Integrating C Functions Works - MACROMEDIA DREAMWEAVER 8-EXTENDING DREAMWEAVER Manual

Extending dreamweaver
Table of Contents

Advertisement

CHAPTER 21
C-Level Extensibility
The C-level extensibility mechanism lets you implement Macromedia Dreamweaver 8
extensibility files using a combination of JavaScript and custom C code. You define functions
using C, bundle them in a dynamic linked library (DLL) or a shared library, save the library in
the Configuration/JSExtensions folder within the Dreamweaver application folder, and then
call the functions from JavaScript using the Dreamweaver JavaScript interpreter.
For example, you might want to define a Dreamweaver object that inserts the contents of a
user-specified file into the current document. Because client-side JavaScript does not provide
support file input/output (I/O), you must write a function in C to provide this functionality.

How integrating C functions works

You can use the following HTML and JavaScript to create a simple Insert Text from File
object. The
objectTag()
stored in a library named
<HTML>
<HEAD>
<SCRIPT>
function objectTag() {
fileName = document.forms[0].myFile.value;
return myLibrary.readContentsOfFile(fileName);
}
</SCRIPT>
</HEAD>
<BODY>
<FORM>
Enter the name of the file to be inserted:
<INPUT TYPE="file" NAME="myFile">
</FORM>
</BODY>
</HTML>
function calls the
readContentsOfFile()
.
myLibrary
2 1
C function, which is
457

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DREAMWEAVER 8-EXTENDING DREAMWEAVER and is the answer not in the manual?

This manual is also suitable for:

Dreamweaver 8

Table of Contents