Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual C++ 6.0 to write user DLL for Mathcad 2000 1

Status
Not open for further replies.

CAOranger

Structural
May 19, 2004
16
I compiled and built the example file 'multiply.c' provided in the userfi folder. I copied 'multiply.dll' file to userfi folder and added function info in 'user.xml' file, but when I wanted to used the function, my function does not appear in the list of user functions.

I used Microsoft Visual C++ 6.0. The provided text file says they tested for Visual C++5.0, and do not gurantee if it works with the later versions.

Have anybody used VC++6.0 to create user dll that can be run on Mathcad 2000? If so, could you please email me a sample, so I could see if it works on my machine?

Thanks.
 
Replies continue below

Recommended for you

You need to register the DLL. Have you run REGTOOL from the Mathcad folder?

TTFN
 
Hi IRstuss,
Now I am able to see the user functions without invoking REGTOOL. I realized, the problem was with the dll itself.

I am disappointed with MathSoft that they allow so little freedom to us as to the functionality. I wish Mathsoft be bit more open minded and liberal.
 
I'm not sute what you mean. There have been some pretty good DLLs written by various people.

An overly flexible interface is simply asking for trouble from a support perspective. By limiting the scope of the interface, Mathsoft limits the number of potential problems and incompatibilities that might occur.

TTFN
 
In my experience I have never had to use REGTOOL with the DLLs I have written. I have used both Microsoft Visual Studio 6.0 and the freeware Dev-Cpp to produce code.

I agree with CAOranger about the interface being too narrow. Being able to pass string data (as opposed to arrays of characters) would certainly be a start.

The last time I did this was with Mathcad 2001, has anyone written DLL code to interface to the newer versions? How does the programming interface compare to earlier versions? Hopefully there have been improvements.

-Matt
 
AFAIK, the interface is unchanged through V12beta3.



TTFN
 
Facility to pass strings would be helpful!

After spending weeks playing with the mathcad user DLL thing, I decided, it is not worth spending time.

I have not seen any examples in the web or elsewhere where the user dll could display more than one lines (stings & numbers). My problem is - regardless of how accurate I am, if my dlls do not show some critical intermediate results, even my co-worker would hesitate to use it for serious purpose. The first thing the person reviewing my calculations would question validity of the result. Even if I look at it after a month, I would be spending time to check the algorithm again before useing it.

If the dlls are for myself, I do not see any use of spending time writing and debugging dlls -- mathcad spreadsheets alone are adequate.

I feel mathsoft would not like to give too much control to developers; is being too overprotective.
 
I ran across a Mathcad DLL awhile back (>2 years ago) that used an efficient way of passing data between the Mathcad worksheet and the user DLL. Basically, functions were written in the worsksheet that would "pack" the data into a single array, then shove it over to the DLL, and the DLL would then "unpack" that array into the different data types -- complex arrays, strings, etc. I'll see if I can dig it up.

-Matt
 
I found the files I was looking for. :) I ran across them a year ago and had to find the URL again.

Browse over to to see a really good example of passing and returning complex data between Mathcad and a user DLL.

All of the Mathcad "pack" and "unpack" functions are available, as well as the .c source file used to perform the processing.

Hope that helps!
-Matt
 
Thanks Matt,
I will look at the code if I can learn something new from it....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor