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 for Programming
 Forum for Origin C
 How to include a file with dynamic folder name

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
newuser_ca Posted - 10/15/2012 : 3:06:22 PM
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\)
2   L A T E S T    R E P L I E S    (Newest First)
newuser_ca Posted - 10/16/2012 : 09:47:10 AM
Thanks a lot.
It works well now.
Penn Posted - 10/16/2012 : 01:28:08 AM
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

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