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 for Programming
 Forum for Origin C
 How to include a file with dynamic folder name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

newuser_ca

70 Posts

Posted - 10/15/2012 :  3:06:22 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin 8.6 in Win7
Origin 8.5 in Win7

Hi,

I have 2 different Origin versions (8.5 & 8.6) in 2 different machines.
I have some commonly-used functions in abc.c under user system folder (eg. c:\Users\origin\Documents\OriginLab\85\User Files\OriginC\ in 8.5 version). It will be compiled automatically when Origin starts.

I have a header file called abc.h under the same directory. I hard coded the path to include this file in different Origin Project with:
#include "c:\Users\origin\Documents\OriginLab\85\User Files\OriginC\abc.h"

If I move the project to a server with Origin 8.6, the above codes won't work.
Origin has different system path with different version. How can I use the dynamic path? I tried
#include GetOriginPath(ORIGIN_PATH_USER) + "OriginC\abc.h"
and it is not working.

Unless I put abc.h under other folder with fixed name (eg. c:\folder123\)

Penn

China
644 Posts

Posted - 10/16/2012 :  01:28:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

According to your description, you have put the source file and the header file to the same folder, which is the User Files Folder. Then you can just include the file without the file path, such as

#include "abc.h"


Penn
Go to Top of Page

newuser_ca

70 Posts

Posted - 10/16/2012 :  09:47:10 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot.
It works well now.
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