The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Support C++ in external DLL fitting function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Leo_Li

China
Posts

Posted - 03/05/2007 :  11:43:31 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System: Winxp

Trying to fit a quite complex user-defined external dll function. The template provided in File Exchange supports .c grammar only. Is there any template showing how to code external dll by .cpp in visual c 6.0? thanks.

-leo


Leo_Li

China
Posts

Posted - 03/07/2007 :  12:02:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Seems that Ocolleagues are busy so I did it by myself. Here is the procedure to share with those who have the same request.

Definition of the problem:
If you want to sovle a complicated fitting problem, which involes
1) calculation of complex numbers (#include <complex>);
2) calling memeber functions of an existing C++ class;
3) you are an OOP lover.

Solution of the problem:
General an external DLL for the fitting function based on
http://www.originlab.com/FileExchange/details.aspx?fid=105

Modifications required:
1) rename FitFuncs.c to FitFuncs.cpp
2) replace FAR PASCAL by __stdcall
3) delcare LPDOUBLE and LPSHORT in this way instead:
typedef double* LPDOUBLE;
typedef short* LPSHORT;

that's all.
-leo

Go to Top of Page

larry_lan

China
Posts

Posted - 03/07/2007 :  12:14:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks, Leo

God, I just want to wait for CP to answer this post, ^_^

Larry
OriginLab Technical Services
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000