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
 All Forums
 Origin Forum
 Origin Forum
 Support C++ in external DLL fitting function

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Leo_Li Posted - 03/05/2007 : 11:43:31 PM
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


2   L A T E S T    R E P L I E S    (Newest First)
larry_lan Posted - 03/07/2007 : 12:14:49 AM
Thanks, Leo

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

Larry
OriginLab Technical Services
Leo_Li Posted - 03/07/2007 : 12:02:11 AM
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


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000