cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Prime 3.0 User Function

SOLVED
Highlighted
Marble

Prime 3.0 User Function

Anyone having trouble linking a user function with the user library in Prime 3.0? I can't even link the basic examples. I get an error message:

External _CreateUserFunction not found

from the linker. It's definitely defined in mcaduser.h that I compiled with. It's like it wasn't exported from mcaduser.lib

Anyone else having this problem?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Prime 3.0 User Function

Jeff,

This typically happens to me when I am linking on a 64 bit machine but my Configuration manager in Dev Studio is building a Win32 project.

I build Customer Functions in prime 3.0 all the time and it works fine and CreateuserFunction is definitely resolved by MCADUSER.LIB .. but you have to link 32 bit lib for 32 bit targets and 64 bit lib for 64 bit targets, otherwise underfined errors occur.

8 REPLIES 8

Re: Prime 3.0 User Function

Jeff Henning wrote:

Anyone having trouble linking a user function with the user library in Prime 3.0? I can't even link the basic examples. I get an error message:

External _CreateUserFunction not found

from the linker. It's definitely defined in mcaduser.h that I compiled with. It's like it wasn't exported from mcaduser.lib

Anyone else having this problem?

I have others problem user library in Prime 3.0:wspPrimr.png

Re: Prime 3.0 User Function

Jeff,

This typically happens to me when I am linking on a 64 bit machine but my Configuration manager in Dev Studio is building a Win32 project.

I build Customer Functions in prime 3.0 all the time and it works fine and CreateuserFunction is definitely resolved by MCADUSER.LIB .. but you have to link 32 bit lib for 32 bit targets and 64 bit lib for 64 bit targets, otherwise underfined errors occur.

Re: Prime 3.0 User Function

John T. Sheehan wrote:

I build Customer Functions in prime 3.0 all the time and it works fine

Do you have a list of Customer Functions in the list of Prime functions? As in Mathcad 15 - see please my picture above.

Do you have problems with units.

Re: Prime 3.0 User Function

Hi Valery

No, there us no User EFI display in Custom Functions .. yet. It is on the list but frankly not a high priority.

I will conitnue to fight for it.

My functions so far are unitless. The 225 Prode functions, my gmtime (time and date) and the read/write HDF.

Is there something I should be afraid of? I am trying to think, but Mathcad EFIs did not handled units at all, you added them after outputting arrays and vectors, by multiply output by unit.

Re: Prime 3.0 User Function

John,

Thanks muchly. I started figuring out the 32/64-bit issue on my own yesterday and finally go it to compile. When I stopped using the command line instructions that PTC provided in the help and moved to the Visual Studio interface, I realized I had the option between Win32 and x64 platforms. Switching to x64 cleared all the errors and warnings in the link step. Interestingly, Prime 3.0 still gives instructions in the help file for using -DWIN32 on the compile line to create a 32-bit object; when most of the world has moved on to Windows 7 or Windows 8. That needs to be updated; I believe you either leave the switch off, or use the switch -DWINDLL.

Moving my DLL to the Custom Functions directory, however, didn't go so well. None of my functions were recognized and the built-in CustomFunctions routine didn't return any of my function names; in fact, it crashed Prime 3.0. Perusing the Project Properties turned up that I had forgotton to set the DLL Entry Point in VisualStudio. This is a switch on the command line instructions that I missed. Once I did that, all my functions started working and CustomFunctions no longer crashes the programm.

The good news is that my library of functions from my Mathcad 15.0 DLL (there are about 100 of them) compiled directly with absolutely no modification needed to my source code. Outstanding!

The developers need to figure out a way to integrate the custom functions into the interface (like under a Custom Functions category) as well as integrating context sensitive help files into the help system. This was an extremely robust and easy to use system in Mathcad 15.0 that is sorely needed to support DLLs in Prime. My users (600 to 1,000 of them in our company) depend on these help files to make use of these DLL functions. DON'T GIVE UP THE FIGHT! We're behind you!

Thanks!

Re: Prime 3.0 User Function

Awesome news Jeff. I will keep fighting for more support for Custom Functions.

I would love to hear from any developer who has successfully debugged a custom function using Dev Studio .. attached to Mathcad 15 or Prime 3.0 exe. That would be blog worthy in my mind. It shoudl work but with the projects I have I will get to try that in 6 months.

Re: Prime 3.0 User Function

Can you provide any guidance of how to debuf and alin to a running process of MathCAD?

 

thanks

 

 

Re: Prime 3.0 User Function

I think there are typos in that question.  I don't understand it.  Can you correct or rephrase the question?