Author |
Topic |
|
jimstar
7 Posts |
Posted - 04/09/2013 : 02:39:31 AM
|
Origin Ver. and Service Release (Select Help-->About Origin): Operating System: 8.0724
hi, I am trying to write an Origin C program to fit my data. I started with importing data into worksheet. I copied the example from Origin C wiki, which was as follows:
#include <..\Originlab\FileImport.h> void load_import_filter_ex() { Page pg = Project.Pages(); // Active Page // Get page book name string strPageName = pg.GetName(); // Get Origin sample folder string strPath = GetAppPath(TRUE) + "Samples\\Import and Export\\"; // List all file names need to imported StringArray saFileNames; saFileNames.Add(strPath + "pCLAMP\\93310C08.DAT"); saFileNames.Add(strPath + "pCLAMP\\93310C10.DAT"); saFileNames.Add(strPath + "pCLAMP\\93311C01.DAT"); // specify .oif filter name, location see the setting of nLocation below. string strFilterName = "pCLAMP"; // import filter tree // about filter settings, refer to imppClamp xfunction tree variable "options" Tree trFilter; int nLocation = 1; // Origin exe folder, more options see the document of load_import_filter function. int nRet; nRet = load_import_filter(strFilterName, saFileNames[0], strPageName, nLocation, trFilter); if ( 0 == nRet ) out_str("Success to load import filter!"); else out_str("Failed to load import filter!\nPlease check strFilterName and nLocation if assigned correctly"); }
And of cause I changed the file path and name. Before compiling, I ran "run.LoadOC(Originlab\FileImport.c, 16)" in the command window. But an error occurred "Error, function or variable load_import_filter not found".
Would you please help me to found out why? Thank you very much!
|
|
jimstar
7 Posts |
Posted - 04/09/2013 : 04:51:08 AM
|
An error message occurred when running the script run.LoadOC("OriginLab\FileImport.c",16)"
"D:\Program Files\OriginLab\Origin8\OriginC\ORIGINLAB\IW_FILTER.C(1784) :Error, Function fuGetImportMode@IAAAAAAAOGAAAAAA was called, but its body could not be located during linking."
Any idea?
|
Edited by - jimstar on 04/09/2013 04:52:53 AM |
|
|
Laurie
USA
404 Posts |
Posted - 04/15/2013 : 1:49:40 PM
|
I was successful here. The only difference is that I was running Origin 8.0 SR6. Maybe you can try selecting Help:Check for Updates to get the latest update.
You actually do not need the run.loadOC( ) as that is what the #include <..\Originlab\FileImport.h> statement is for.
OriginLab Technical Support |
|
|
jimstar
7 Posts |
Posted - 04/15/2013 : 10:29:04 PM
|
I just try the Origin 9 SR2 evaluation version. The problem remained the same. Is there any problem with the install directory and user directory? I installed the origin on D drive and the user directory on C drive. |
|
|
Laurie
USA
404 Posts |
Posted - 04/17/2013 : 10:19:16 AM
|
Ok, this is a bit trickier, and I think I got lucky when I first tested this, meaning that the necessary header files were already loaded by some other operation I had done in Origin.
Please try the following: You need to exclude your C file from the CodeBuilder workspace when you run the "run.LoadOC(Originlab\FileImport.c, 16)" script. Then this file will compile and link successfully. You can then add back your C file and Build it.
OriginLab Technical Support |
|
|
jimstar
7 Posts |
Posted - 04/18/2013 : 08:27:26 AM
|
I have tried as you guided, but the problem remained the same. What the hell is going on? |
|
|
jimstar
7 Posts |
Posted - 04/18/2013 : 9:41:17 PM
|
|
|
|
jimstar
7 Posts |
Posted - 04/24/2013 : 10:47:08 PM
|
quote: Originally posted by Laurie
Ok, this is a bit trickier, and I think I got lucky when I first tested this, meaning that the necessary header files were already loaded by some other operation I had done in Origin.
Please try the following: You need to exclude your C file from the CodeBuilder workspace when you run the "run.LoadOC(Originlab\FileImport.c, 16)" script. Then this file will compile and link successfully. You can then add back your C file and Build it.
OriginLab Technical Support
I did as you say but no good. Can you help me to find out why? Thanks a lot. |
|
|
rlewis
Canada
253 Posts |
Posted - 04/25/2013 : 6:53:26 PM
|
By trial and error I found that posted code will compile (and execute) only if the the following Originlab files are included in the system WorKspace
FileImport.c dragNdrop.c fu_utils.c IWBase.c AscImpOptions.c import_utils.c
Why not give it a try ... |
Edited by - rlewis on 04/26/2013 12:35:16 AM |
|
|
jimstar
7 Posts |
Posted - 05/03/2013 : 04:56:55 AM
|
I tried but no good.
quote: Originally posted by rlewis
By trial and error I found that posted code will compile (and execute) only if the the following Originlab files are included in the system WorKspace
FileImport.c dragNdrop.c fu_utils.c IWBase.c AscImpOptions.c import_utils.c
Why not give it a try ...
|
|
|
|
Topic |
|