Specifications
C-Level Extensibility 267
If fileURL is not in the Dreamweaver MX Configuration folder, the function deletes the
specified file.
Arguments
char *fileURL is a pointer to a string that names the configuration folder to remove, which is
provided as a file URL (file://).
Returns
JSBool
Example
char dwConfig = "file:///c:|Program Files\Macromedia\Dreamweaver
MX\Configuration\Objects\insertbar.xml";
MM_DeleteConfigFile(dwConfig);
Calling a C function from JavaScript
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.
This example requires four files, which are included in the Extending/c_files folder inside the
Dreamweaver application folder:
• mm_jsapi.h is a header file that includes definitions for the data types and functions that are
described in “C-level extensibility and the JavaScript interpreter” on page 253.
• mm_jsapi_environment.h, which defines the MM_Environment.h structure.
• Sample.c is an example file that defines the computeSum() function.
• Sample.mak is a makefile that you can use to build Sample.c into a DLL with Microsoft Visual
C++; Sample.proj is the equivalent file for building a CFM Library with Metrowerks
CodeWarrior. If you use another tool, you can create the makefile.
To build the DLL in Windows:
1 In Microsoft Visual C++, choose File > Open Workspace and select Sample.mak.
2 Choose Build > Rebuild All.
When the build operation finishes, a file called Sample.dll appears in the folder that contains
Sample.mak (or one of its subfolders).
To build the shared library on the Macintosh:
1 Open Sample.proj in Metrowerks CodeWarrior.
2 Build the project to generate a CFM Library.
When the build operation finishes, a file called Sample appears in the folder that contains
Sample.proj (or in one of its subfolders).
To call the computeSum() function from the Insert Horizontal Rule object:
1 Create a folder called JSExtensions in the Configuration folder within the Dreamweaver
application folder.
2 Copy Sample.dll (Windows) or Sample (Macintosh) to the JSExtensions folder.
3 In a text editor, open the file called horizontal_rule.htm in the Configuration/Objects/
Common folder.