Author |
Topic |
|
invenies
Germany
4 Posts |
Posted - 02/11/2014 : 06:17:14 AM
|
Origin Ver. and Service Release (Select Help-->About Origin): 8.6G 32-bit Sr1 Operating System: Windows 7 32-bit
Hi,
I have been trying to import the example files for an external fit function dll into Visual C++ 2010 (http://www.originlab.com/FileExchange/details.aspx?fid=105), without any success. Does someone here have working code for one of these more recent versions of Visual Studio that I could adapt?
Best, Michael Krüger
Michael Krger U. Erlangen-Nuremberg Staudtstrae 1 D-91058 Erlangen Germany |
|
Echo_Chu
China
Posts |
Posted - 02/12/2014 : 04:51:59 AM
|
Hi, Michael
The one in file exchange page is for Origin 7.5. In Origin 8.6, you can try the Fitting with External DLL.opx, in the <exe>\Samples\Curve Fitting folder (<exe> is the folder where your Origin installed)
After you drag-and-drop the .opx file into Origin workspace, a new folder will be created in your Origin user folder. In the folder, there are Microsoft Visual C++ workspace, Sample data and Instructions to show you how to create such DLLs. The sample files support Visual C++ 2010
Echo OriginLab Corp
|
|
|
invenies
Germany
4 Posts |
Posted - 02/12/2014 : 12:42:36 PM
|
Hi Echo,
Thank you for your quick reply! From these example source files I managed now to create a DLL which unfortunately doesn't work in Origin.
I had to create a new project in VC++ 2010, with the following specification: Win32 Project -> DLL -> empty project. I added all files manually to the project. Compiling works fine, but only after disabling incremental linking in Configuration Properties -> Linker -> General.
Curve fitting "Quick test" fails as well as fitting itself (example data and fdf Asymptotic2). I can't get any life sign of the DLL inside Origin. Everything else is fine: file locations, DLL name and function name. Do you have an idea what this might be? I hope that external dll curve fitting is not broken alltogether? By the way, I am using Origin 9.1.0 Sr1 now.
Best regards
Michael Krueger U. Erlangen-Nuremberg Staudtstrasse 1 D-91058 Erlangen Germany |
|
|
Echo_Chu
China
Posts |
Posted - 02/13/2014 : 04:54:22 AM
|
Hi, Michael
Have you successfully build the FitFuncs.dll by clicking Build:BuildFitFucs.dll?
And have you copied the dll from \release folder to the main Origin EXE folder?
They are step 6 and step 7 in Fitting with External DLL.pdf, which locates in the new folder created after you drag and drop the OPX to your Origin.
If yes but you still have problem, could you send us your dll and your functions definition file (*.FDF) at your User Files Folder(UFF),which can be found from the fitfunc subfolder under the User Files folder
And if the source files you build the dll is different from we provided in the OPX, please also send them to us.
You could follow the instructions below to send your file. http://www.originlab.com/index.aspx?go=Support&pid=752
Echo OriginLab Corp.
|
|
|
invenies
Germany
4 Posts |
Posted - 02/13/2014 : 7:18:25 PM
|
Hi Echo,
I made no mistake with these steps. So I uploaded all source files including the dll and the fdf file, the name of the file is FitFuncs.zip. Herein you find a README file that explains my steps to compiling the DLL from the original example source files. I have not changed any code and have not amended the fdf file.
Thank you for your help!
Best wishes,
Michael Krueger U. Erlangen-Nuremberg Staudtstrasse 1 D-91058 Erlangen Germany |
|
|
Echo_Chu
China
Posts |
Posted - 02/14/2014 : 01:50:53 AM
|
Hi, Michael
I tried your dll and it does not work. However, I built the dll from the sample files provided in the OPX and it works fine. I will send you my dll via email so that you can try.
There must something wrong when you build your dll.
Could you try following in Visual C++ 2010
1. Select File: Open: Project/Solution 2. Browse to the "Fitting with External DLL" folder, which is generated from the OPX 3. Select FitFuncs.dsp to open ---> Visual C++ 2010 will ask to convert the file to a compatible version. Click OK 4. Browse to the "Fitting with External DLL" folder and select FitFuncs.vcxproj, which is just generated by visual c++ 5. Select Build:BuildFitFucs.dll from menu to build the dll
Note: Please pay attention that if you build Win32 version dll then you must run Origin 32 bit to make the fit working.
To build dll as Win 32 or Win 64 version is controlled by the Solution Configurations toolbar as below
Echo OriginLab Corp |
|
|
invenies
Germany
4 Posts |
Posted - 02/14/2014 : 09:21:57 AM
|
Dear Echo,
Everything is working fine now. Somehow I missed that .dsp to .vcproj conversion actually works. So this is what you should do if you want to build your own external curve fitting DLL.
Thank you so much for your assistance!
Best wishes,
Michael Krueger U. Erlangen-Nuremberg Staudtstrasse 1 D-91058 Erlangen Germany |
|
|
|
Topic |
|
|
|