There are a few undocumented variable types that you can pass to a user DLL, including a string type. I don't have a reference here - you may want to look in older discussions.
The technique I use is more brute-force but is also documented:
1) In the Mathcad worksheet create an ASCII array containing the string elements using str2vec()
2) Pass this array to the DLL function, which may look like this:
#define FILENAME_TOO_LONG 6
#define CANNOT_ACCESS_FILE 7
LRESULT fProcessFile( COMPLEXARRAY * const COutput, const COMPLEXARRAY * const CFilename )
{
char fname[2000];
long i;
HANDLE hFile;
// Create file name
if( CFilename->rows > 1998 ) return MAKELRESULT( FILENAME_TOO_LONG, 1);
for( i = 0; i < CFilename->rows; i++ ) fname[i] = (char) CFilename->hReal[0][i];
fname[i] = '\0';
// Try to open the file
hFile = CreateFile( fname, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL );
if( hFile == INVALID_HANDLE_VALUE ) return MAKELRESULT( CANNOT_ACCESS_FILE, 1);
...
CloseHandle( hFile );
return 0;
}
Xavier