Hi Chris. Great to see you charging into the largely unexplored [FileExecute,…] command, and making progress.
I will probably repeat some things you already know, but just to make sure anybody reading starts on the same page I will explain some fundamentals of calling DLL functions. At least as how I understand them. Note that I know very little about windows programming and what I will show is simply what has worked for me. There is most likely a proper procedure on how to write and manage the DLL functions so do not take my word as gospel.
First of all, the main purpose of the [FileExecute,…] command is to call a function within a DLL specifically written for Zbrush. Although you can call various functions from DLLs already on your system the arguments of the [FileExecute,…] command cannot be extended or reordered as they are locked to the zscripting language. That means only DLLs written for Zbrush or DLLs with functions that fit the limited argument space, can be used.
In order to use DLL functions with more input arguments than [FileExecute,…] allows you must write your own DLL which in return calls your desired DLL function.
The [FileExecute,…] command itself is simple enough. You need to know the path where the DLL file is stored, what the name of the function is and the required input arguments.
<b>[[color=Lime]FileExecute, [i]Filename[/i] , [i]Routine to call[/i], [i]Optional text input, Optional number input[/i], [i]Optional memory block input[/i], [i]Optional memory block output[/i]</b>]
</span>Filename is simply the name of the DLL file including the .dll extension. For help on determining the path, read through the [<b>controlling Subdirectory paths in ZScript</b>](http://www.zbrushcentral.com/zbc/showthread.php?t=20494&page=1&pp=15) thread.
Routine to call is the exact name of the DLL function. You must use the exact [i]UPPER[/i] and [i]lower[/i] case of the function name. 'MessageBoxA' , for example.
[color=Blue]<b>[color=Navy]Optional text input</b> </span></span>Is passed to the function as a pointer to the first character in the line of text. If you are calling a DLL function that does not require a text argument do not give it one. Usually used for passing a path and/or filename, but as Chris showed you can use it to pass multiple arguments to a specially written DLL.
<b>Optional number input</b> Is passed to the function as the value itself, not a pointer. Zscript variables are double precision real numbers (Floating points) by default. If you are calling a DLL function that does not require a number argument do not give it one.
[color=Blue]<b>[color=Navy]Optional memory block input</b> </span></span>Is passed to the function as a pointer to the first byte. Is only used with DLL functions specifically written for Zbrush. Although it is labelled an input argument I found it is perfectly acceptable to write to the memory block address from the DLL function.
[color=Blue]<b>[color=Navy]Optional memory block output</b> </span></span>Due to my lack of windows programming experience I cannot write to the memory block without crashing Zbrush. Maybe it is passed as a handle of a memory allocation? But as the [i]memory block input[/i] apparently can serve a dual purpose it is not a big deal right now. Or maybe it is an output from zbrush [i]only[/i] memory block.
So to answer your initial question on how to use the Numerical and Memory Block input parameters.
Assuming we have the following [FileExecute,...] command:
<b>[[color=Lime]FileExecute, "example1.dll", TestFunctionG, "Hello Zbrush", 3, TV_TestMemblock]</span></span></b>
your DLL function definition should read the following (compiler requirements aside):
[color=Lime]DLLIMPORT void TestFunctionG ( unsigned char *message, double repeat, void *memblock)
Hope that helps.
For others wanting to dig into DLL programming I can highly recommend the [BloodShed Dev-C++](http://www.bloodshed.net/) suite which includes the MinGW compiler system and uses GCC 3.4.2. MinGW is a collection of "Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs.". Dev-C++ is [Free Software](http://www.gnu.org/philosophy/free-sw.html) distributed under the [GNU General Public License](http://www.gnu.org/licenses/gpl.txt).