Mathcad Prime 9, DLL in C, use of 'INFILE' / 'OUTFILE' example code request
I would like to write a user-defined function for Mathcad Prime 9.0 accessible via DLL. I intend to use 'C' programming language. Your supplied header file (excerpt below) refers to methods of function definition which will pass string pointers that are automatically parsed into file names with full paths as needed (#define INFILE 13). There is also discussion of assigning the function output to a file which will be written (#define OUTFILE 14). I would like to use this functionality. Can you supply working example 'C' code? In the worst case, maybe you can supply working 'C++' code. What I have tried, with the same construction as your examples for other passed-in arguments, as well correct memory allocation for output strings, has not worked. Of course, I don't know why and I don't think I have a way to debug this in real time since I don't have your object files (also I am a beginner C programmer). Thank you in advance for the example code. - Kirk Morgan
********
// types to be used in declaration of the function's
// arguments and of the return value
#define COMPLEX_SCALAR 1
#define COMPLEX_ARRAY 2
#define STRING 8
//
// File name variables. These are passed as const char *pointers
// if the string doesn't look like it has a path in it then
// the current working directory will be prepended to the string
// before it is passed to the user function.
//
//
// your function will be passed a const char * pointer
#define INFILE 13
// an OUTFILE is like an INFILE except it allows you
// to put your function on the left side of a := like
// the WRITEPRN() builtin
#define OUTFILE 14
// use this structure to create a function
#define MAX_ARGS 10

