quote:
Originally posted by j@y
Hi everyone,
To be able to import a file, I need to run.LoadOC(Originlab\FileImport.c, 16); in Command Window. Is it possible in general to execute a Command Window's expression from the C code? Something like LabTalk's LT_execute()?
Many thanks for your help!
The run.loadoc() is really annoying. Two solutions as far as I can see:
1. Create a toolbar (or ogs file...), when click a button on the toolbar, first run.loadoc(originlab\fileimport.c, 16), then run.loadoc(your_source_code, 16), and finally invoke your function....
2. Take int ImportASCII() for example,
first, typedef int (*FIMPORTASCII)(Page &pgTarget, TreeNode &trFilter, LPCSTR lpcszFile, int nFile);
then
Function fn = Project.FindFunction("ImportASCII", GetAppPath(TRUE) + "OriginC\\OriginLab\\FileImport.c");
FIMPORTASCII pf = fn;
pf(....);
See the example of Project::FindFunction().
©c¡Ï ¤È¥¹ ©f¨u©c ©c¥ì ¥Î¤³ ©c/ ©¦£¯
©c¨Ê¥Î ¤´¥¨ ¥ó ¨× ¥ó¤á' ¥Ì©¦¥ /¤í ¥Õ©¦©f
¨Ö ¦á ©¦£þ ©` ¥Õ ©¦
©¦