Используйте структуру FUNCTIONINFO для регистрации пользовательской функции в PTC Mathcad. Эта структура содержит информацию об имени, по которому PTC Mathcad распознает функцию, описание параметров функции, ее аргументов, ее возвращаемого значения, и указатель на код, который выполняет функцию.
Пример
FUNCTIONINFO Multiply = { // The function name, as it should appear in Mathcad "Multiply", // The function arguments "a,M", // A brief description of the function "Returns the product of the scalar a and the matrix M", // The call to your code (LPCFUNCTION)MyCFunctionname; // The type of the result COMPLEX_ARRAY, // The number and type of the arguments 2, {COMPLEX_SCALAR, COMPLEX_ARRAY} };